Re: How to apply something to every variable
| From: | Chris Anderson | Date: | Sun, 08 Jul 2001 00:44:44 +0000 |
| Subject: | Re: How to apply something to every variable | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56696@lists.php.net to get a copy of this message | ||
The true point of that snippet was to apply something to all my variables.
Plus, not all servers have that option on :>
----- Original Message -----
From: <teo@gecadsoftware.com>
To: <php-general@lists.php.net>
Sent: Saturday, July 07, 2001 7:49 AM
Subject: Re: [PHP] How to apply something to every variable
> Hi Chris!
> On Fri, 06 Jul 2001, Chris Anderson wrote:
>
> > I was playing around trying to find a way to addslashes() to all my
> > variables, and I came up with this snippet. Hope it helps someone
> >
> why don't you turn on magic_quotes_gpc then?
>
> > $keys = array_keys($HTTP_POST_VARS);
> > $post_size = sizeof($keys);
> > for($x = 0; $x < $post_size; $x++)
> > {
> > $temp = $keys[$x];
> > //you can replace addslashes with whatever you want to use
> > ${"$temp"} = addslashes($HTTP_POST_VARS["$temp"]);
> > }
> -- teodor
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>