| Server IP : 23.94.149.180 / Your IP : 216.73.216.147 Web Server : nginx/1.20.1 System : Linux deadrock 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 15:18:14 UTC 2026 x86_64 User : nginx ( 991) PHP Version : 8.6.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /files/www/hacklab/ |
Upload File : |
<html>
<head>
<title>Listing 9.1 Looping through the $GLOBALS array</title>
</head>
<body>
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
function print_array($arrayname)
{
static $calls;
if ($calls > 100)
return;
#print "---------- Displaying $arrayname $calls ----------<br>";
$calls = $calls + 1;
print "<br><table border=\"2\">";
print "<Br>\n";
foreach ( $arrayname as $key=>$value)
{
$vartype = gettype($value);
if ($key == "GLOBALS" and $calls > 4)
return;
print "<tr><td>$key</td><td>$value</td><td>$vartype</td></tr>";
#print "$key $value $vartype <br> \n";
if ($vartype == "array")
{
print "</table>\n";
print_array($value);
}
else
;#print "</table>\n";
}
}
print "Starting out<br>";
print_array($GLOBALS);
print "Done<br>";
?>
</body>
</html>