Voting

: max(four, four)?
(Example: nine)

The Note You're Voting On

Sopinon
19 years ago
If you want to display the hole structure (tree) of your array, then you can use this recursive solution.

<?PHP
$tree
= "";
array_tree($your_array);
echo
$tree;

// Recursive Function
function array_tree($array, $index=0){
global
$tree;
$space="";
for (
$i=0;$i<$index;$i++){
$space .= " ";
}
if(
gettype($array)=="array"){
$index++;
while (list (
$x, $tmp) = each ($array)){
$tree .= $space."$x => $tmp\n";
array_tree($tmp, $index);
}
}
}
?>

<< Back to user notes page

To Top