Re: extracting vars
| From: | Robin Vickery | Date: | Thu, 19 Oct 2000 10:57:19 +0000 |
| Subject: | Re: extracting vars | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21137@lists.php.net to get a copy of this message | ||
>>>>> "mw" == mike wright <php@theorb.net> writes:
> Hi All, After decrypting a URL variable I get a string like
> id=5&title=doctor
> I want to end up with regular variables $id and $title.
> I explode it into $test on "&" and then again on "=" and end up
> with this: $test[0][0] = id $test[0][1] = 5 $test[1][0] = title
> $test[1][1] = doctor. I then try "extract( $test )" but get no
> results.
> Would somebody give me a hand on this? Any help will be greatly
> appreciated.
You could just use parse_str(string str [, array arr])
http://www.php.net/manual/function.parse-str.php
-robin
--
Robin Vickery...............................................
Planet-Three, 3A West Point, Warple Way, London, W3 0RG, UK
Email: robin@planet-three.net Phone: +44 (0)870 729 5444