note 40633 deleted from ref.array by nlopess
| From: | nlopess@php.net | Date: | Wed, 10 Mar 2004 16:29:29 +0000 |
| Subject: | note 40633 deleted from ref.array by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66564@lists.php.net to get a copy of this message | ||
Note Submitter: mats.NOSPAM@datatal.se
----
simplified version of [spam (at) speedcapture . com]'s great debug-function viewArray
Can't even count the number of times this function helped me out.
<?php
function viewArray($arr)
{
echo '<table border=1 cellpadding=0 cellspacing=1>';
foreach ($arr as $key => $elem)
{
echo '<tr valign=top><td>'.$key.' </td><td>';
if (is_array($elem))
viewArray($elem);
else
echo htmlspecialchars($elem).' ';
echo '</td></tr>';
}
echo '</table>';
}
//for example:
viewArray($_SERVER);
?>