Re: Remove element(s) from QUERY_STRING
| From: | Andrei Zmievski | Date: | Tue, 18 Jul 2000 16:28:31 +0000 |
| Subject: | Re: Remove element(s) from QUERY_STRING | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7097@lists.php.net to get a copy of this message | ||
On Tue, 18 Jul 2000, Niklas Brunlid wrote:
> I need to remove/replace selected pieces of the QUERY_STRING without
> knowing what the rest of it contains. My basic idea right now is to
> explode("&") it into an array, removing (or modifying) the relevant
> array elements and then implode("&") it again. The main problem is
> finding the right element to remove/replace - I can't find any
> array_find function.
>
> I will use this to maintain a set of variables over subsequent calls to
> a collection of php scripts. I can't use session variables because:
> (1) I use several scripts.
> (2) I need to be able to change the values of the variables (they are
> search parameters and general state stuff).
>
> Also, I'd like to avoid cookies whenever possible.
>
> Is there an easy or better way to do this?
Try preg_grep().
http://www.php.net/manual/function.preg-grep.php
-Andrei
"Claiming Java is easier than C++ is like
saying that K2 is shorter than Everest."
-- Larry O'Brien (editor, Software Development)