note 28608 deleted from reserved.variables by sniper
| From: | sniper@php.net | Date: | Tue, 21 Oct 2003 19:44:05 +0000 |
| Subject: | note 28608 deleted from reserved.variables by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59077@lists.php.net to get a copy of this message | ||
Note Submitter: dakota@tensen.net
----
I have often found it helpful in form post situations to be able to view all of the values that have
been submitted by the form to make sure that they are being sent right. I used to have a page that
did this but I then realized that I could make a function out of it. So I did this and then I
realized I could make this take any array variable and so I made it recursive and so it shows
everything inside an array, perhaps like the 'array_walk()' function but I never could get
that to work.
function view_values($VARS)
{
$row = 0;
echo("<table>");
while (list ($key, $val) = each ($VARS))
{
echo ("<tr bgcolor=#" . (($row/2) == floor($row/2) ? "444444" :
"666666") . "><td>$key</td><td>");
if(!is_array($val))
echo("$val</td></tr>\n");
else
echo(view_values($val));
$row++;
}
echo("</table>");
}