RE: [PHP] global generation
| From: | Boget, Chris | Date: | Mon, 07 Jan 2002 19:20:06 +0000 |
| Subject: | RE: [PHP] global generation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-79723@lists.php.net to get a copy of this message | ||
> Wait until after the for loop has completed.
> for ($i=0; $i< $num_results; $i++) {
> $variable[$i];
> }
> global $variable;
That's not going to work. The only thing that is doing is
making an already global instance of $variable global
within the function.
What you want is this instead:
$GLOBALS[$variable] = $variable;
Chris