note 33881 added to function.explode
| From: | php at lixlpixel dot com | Date: | Thu, 10 Jul 2003 03:10:24 +0000 |
| Subject: | note 33881 added to function.explode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51817@lists.php.net to get a copy of this message | ||
'explode' helped me to make my old scripts work with register_globals OFF...
just put this snippet on top of every page or put it on a seperate file and include it.
<?php
$varray = explode("&", $_SERVER['QUERY_STRING' ]);
for( $x = 0; $x <= count($varray); $x++)
{
$var = explode("=", $varray[$x]);
$$var[0] = $var[1];
}
?>
takes only care of variables passed as
xyz.php?foo=bar&morefoo=morebar ...
see the register_globals entry in this documentation to see more (and probably better) solutions.
----
Manual Page -- http://www.php.net/manual/en/function.explode.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33881
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33881&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33881&report=yes