I am trying to print out PHP system arrays by looping through an array of the names of the arrays that I want to print. I am sure there is a simple way of escapeing the array names, but I can't seem too get it.
I have a long hard coded program that works, but I should be able to shorten it like the coding below.
<?php
$x = array("_GET","_POST","_REQUEST","_SESSION","_COOKIE");
foreach ($x as $value)
{
$xx = '$' . $value;
echo $xx . '<br>';
echo '<table border="2" style = "background-color:#d4d4d4">';
foreach ($xx as $key=>$val )
{
echo '<br>value =';
echo "<tr><td style= 'color:red;'>".$key."</td>";
echo " <td style= 'color:black;'>" .$val."</tr>";
}
echo"</table>";
break;
}
?>