note 14172 deleted from function.var-dump by jimw

From: Date: Sat, 08 Dec 2001 23:59:07 +0000
Subject: note 14172 deleted from function.var-dump by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22405@lists.php.net to get a copy of this message
Here's a recursive function to dump any variable (array, string, object) to the screen using <UL> tags. function show_array_tree($a) { if(!is_array($a) && !is_object($a)) { echo $a; return; } echo "<ul>\n"; while(list($key, $val) = @each($a)) { if(is_array($val) || is_object($val)) { echo "$key\n"; show_array_tree($val); } else echo "<LI>$key = '$val'\n"; } echo "</ul>\n"; }

« previous php.notes (#22405) next »