- print_r: documentation ( source)
<?php
function printArray($array) {
if (is_array($array)) {
foreach ($array as $key => $value) {
if ($key != 'GLOBALS') {
if (is_array($value)) {
printArray($value);
} else {
echo $value."<br>";
}
}
}
}
}
print_r($GLOBALS);
printArray($GLOBALS);