note 38723 deleted from function.array by nlopess
| From: | nlopess@php.net | Date: | Mon, 05 Jan 2004 15:42:55 +0000 |
| Subject: | note 38723 deleted from function.array by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62950@lists.php.net to get a copy of this message | ||
Note Submitter: god@beetjevreemd.nl
----
Heh, I was kinda drunk, and this array I am working on went to live its own life. It didn't
like me or so, it just wouldn't do what I told it to do...
So I created this super fuction what puts the array in a nice table, and guess what.. Its
multy-dimention array compatible!
Ghe, so here is the code:
<?php
function dump_array($array) {
echo "<table
border=\"1\"><tr><td>Key</td><td>Value</td></tr>";
foreach($array as $key => $val){
echo "<tr><td>" . $key . "</td><td>";
if (is_array($val)) {
dump_array($val);
} else {
echo $val;
}
echo "</td></tr>";
}
echo "</table>";
}
?>