note 83314 deleted from language.variables by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Jul 2008 15:57:52 +0000 |
| Subject: | note 83314 deleted from language.variables by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142143@lists.php.net to get a copy of this message | ||
Note Submitter: john dot t dot gold at gmail dot com
----
To list all Variables for debug purposes use this:
<?php
echo '<table border=1><tr> <th>variable</th> <th>value</th>
</tr>';
foreach( get_defined_vars() as $key => $value)
{
if (is_array ($value) )
{
echo '<tr><td>$'.$key .'</td><td>';
if ( sizeof($value)>0 )
{
echo '"<table border=1><tr> <th>key</th>
<th>value</th> </tr>';
foreach ($value as $skey => $svalue)
{
echo '<tr><td>[' . $skey .']</td><td>"'. $svalue
.'"</td></tr>';
}
echo '</table>"';
}
else
{
echo 'EMPTY';
}
echo '</td></tr>';
}
else
{
echo '<tr><td>$' . $key .'</td><td>"'. $value
.'"</td></tr>';
}
}
echo '</table>';
?>