Code: Select all
<?php
require('recursive-function.php');
$tree = array(
'core' => array('Iteration One'),
'classes' => array('Iteration One , Iteration One , Iteration One'),
'functions' => array('Iteration One , Iteration One, Iteration One' ,
'Iteration One' => array('Iteration two' , 'Iteration two')),
'template',
'index.php',
'login.php'
);
echo treeOut($tree);
?>
Code: Select all
<?php
function treeOut($tree){
$markup = "";
foreach ($tree as $branch => $twig) {
$markup .= '<li>' . $branch . '</li>';
}
return '<ul>'. $markup . '</ul>';
}
?>
Code: Select all
core
classes
functions
0
1
2