Posted by AlexVN on 11/03/06 17:45
On Nov 3, 5:50 pm, "brett" <acco...@cygen.com> wrote:
> That doesn't seem to work when the URL has a "?" in it:
>
> /blog/?p=4&preview=true
>
> I get up to "/blog/" and that's it. It seems the rest is cut off. I
> suppose that is the query string part. Is there a way to include it so
> I can also check for "preview=true"?
>
> Thanks,
> Brett
http://php.net/parse_url
http://php.net/parse_str
Let $url = '/blog/?p=4&preview=true';
then
$uri = parse_url($url);
parse_str($uri['query'], $get);
echo $get['preview'];
Sincerely,
Alexander
http://www.alexatnet.com/ - PHP/ZendFramework/Ajax blog
[Back to original message]
|