PHP – How to Display REQUEST, POST, and SESSION Variables

Posted on Posted in General IT Info

Here is some quick and dirty PHP code to display all request variables available to a page. This is useful while debugging:

foreach($_REQUEST as $var=>$val)
{
   echo "$var=$val";
}

Replace _REQUEST with _POST or _SESSION and you can see those variables too.

Code

Leave a Reply

Your email address will not be published. Required fields are marked *