<?php
/*
=============================================================================
Name Program : variable_array_dump.php
Author : Aitor Solozabal Merino (Spain)
Email : aitor-3@euskalnet.net
Date : 25-08-2007
Type : php program code utility
Description : A dump in html format of the contents of one array variable with a
: recursive list of contents inclusive nested array variables inside
Installation : Put this programs in a subfolder of the www of your web server
: document root directory
Sample : The global variables $_SERVER, $_ENV, $_REQUEST, $_GET, $_POST and $_COOKIE
*/
function variable_array_dump($VARIABLE_NAME, $VARIABLE_ARRAY){
if (is_array($VARIABLE_ARRAY)) {
$output = "<table border='1'>";
$output .= "<head><tr><td><b>" . $VARIABLE_NAME . "</b></td><td><b>VALUE</b></td></tr></head><body>";
foreach ($VARIABLE_ARRAY as $key => $value) {
$value = variable_array_dump($key, $value);
$output .= "<tr><td>$key</td><td>$value</td></tr>";
}
$output .= "</body></table>";
return $output;
} else {return strval($VARIABLE_ARRAY);}
}
echo variable_array_dump('GLOBAL SERVER', $_SERVER);
echo variable_array_dump('GLOBAL ENV', $_ENV);
echo variable_array_dump('GLOBAL REQUEST', $_REQUEST);
echo variable_array_dump('GLOBAL GET', $_GET);
echo variable_array_dump('GLOBAL POST', $_POST);
echo variable_array_dump('GLOBAL COOKIE', $_COOKIE);
/*
This program code is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation in any version
of the License.
This program is non professional and distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
?>