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

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