GLOBALS
| From: | Urb LeJeune | Date: | Sun, 12 Nov 2000 15:40:56 +0000 |
| Subject: | GLOBALS | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-24862@lists.php.net to get a copy of this message | ||
The following code segment displays the contents of the
GLOBALS array:
foreach ($GLOBALS as $Key=>$Value){
echo "<LI>\$GLOBALS[$Key]=$Value\n";
} # End of foreach ($GLOBALS as $Key=>$Value)
However, some of the array components are also arrays, here
is a portion of the output:
$GLOBALS[HTTP_ENV_VARS]=Array
$GLOBALS[GLOBALS]=Array
$GLOBALS[First]=Urb
$GLOBALS[Last]=LeJeune
$GLOBALS[Language]=PHP4
Note the second line above. One of the components
of the $GLOBAL array appears to be another copy of the
$GLOBAL array.
If I build a function that recursively calls itself to display
nested arrays, it goes into an infinite loop printing the $GLOBAL
array.
What am I overlooking or doing wrong?
Urb