<?php
$global_copy = $GLOBALS;
foreach($global_copy AS $key => $value) {
echo $key.": ";
if(is_array($value)) {
$indent_count = 1;
//dive_into_array ($value, $indent_count);
}
else {
echo $value."<br>";
}
}
function dive_into_array ($variable, $indent_count) {
foreach($variable AS $key => $value) {
echo $key.": ";
if(is_array($value)) {
$indent_count++;
//dive_into_array ($value, $indent_count);
}
else {
for($e = 0; $e < $indent_count; $e++) {
echo " ";
}
echo $value."<br>";
}
}
}
?>