Re: No Global Code Fixing

From: Date: Sat, 04 Jan 2003 18:50:33 +0000
Subject: Re: No Global Code Fixing
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-130245@lists.php.net to get a copy of this message
I just found a better answer, but still open to suggestions.... with the URI : http://rc.mikeathome.net/test/index.php?one=1&two[]=2&two[]=3&three=3&key=This%20is%20the%20key I tried this: <?php if (isset($_GET)){ foreach($_GET as $key => $value){ ${$key}=$value; } echo $one; echo "<br>"; print_r($two); echo "</br>"; echo $three . "<br>\n"; echo $key; } ?> Result: ------------------------------------------------- 1 Array ( [0] => 2 [1] => 3 ) 3 This is the key ------------------------------------------------ And that actually worked....... I can live without the unset()'s. Just need to add the same for POST and do an include with it. Anyone have a better idea? *********** REPLY SEPARATOR *********** On 04/01/2003 at 1:22 PM Michael J. Pawlowsky wrote: > >So just wondering if anyone had something really elegant to replace it. > > >Cheers, >Mike

« previous php.general (#130245) next »