note 14801 deleted from function.is-array by didou
| From: | didou@php.net | Date: | Sun, 18 May 2003 10:11:38 +0000 |
| Subject: | note 14801 deleted from function.is-array by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48493@lists.php.net to get a copy of this message | ||
Note Submitter: dalini@dalini.de
----
Little Array Debug Function will also parse MultiLevelArrays and build a structure
# returns 0 if no array is given
# call: print_array($array,0)
function print_array($array,$level){
if (!is_array($array))
return 0;
reset($array);
while ( list($key, $value) = each($array) ) {
for ($i = 0; $i < $level; ++$i){
echo " ";
}
echo "key: ".$key." val: ".$value."<br>";
if (is_array($value))
print_array($value,$level+1);
}
}