How to print every variable and it's value that is being used in a PHP script
I usually append the following code to any PHP script. Just put it at the very bottom of your script before the last ?>.
<?php
echo("<pre style='background-color:white;'>");
ob_start();
print_r($GLOBALS);
$GLOBALS_contents = htmlentities(ob_get_contents());
ob_end_clean();
echo($GLOBALS_contents);
echo("</pre>");
?>
echo("<pre style='background-color:white;'>");
ob_start();
print_r($GLOBALS);
$GLOBALS_contents = htmlentities(ob_get_contents());
ob_end_clean();
echo($GLOBALS_contents);
echo("</pre>");
?>
[Click to add or edit comments])
Please prepend comments below including a date