|
Posted by C. on 04/25/07 13:04
On 24 Apr, 10:22, "Rami Elomaa" <rami.elo...@gmail.com> wrote:
> "shotokan99" <soft_devj...@yahoo.com> wrote in message
>
> news:1177405709.175883.200600@t39g2000prd.googlegroups.com...
>
> > hi guys,
>
> > my url is in this form: http://www.mysite.com?user=zen
>
> > what to do to remove the query string (..?user=zen) and make my url to
> > this form:http://www.mysite.com
>
> $url = 'http://www.mysite.com?user=zen';
> list($shorturl) = explode('?', $url);
> echo $shorturl;
>
> --
> Rami.Elo...@gmail.com
>
> "Good tea. Nice house." -- Worf
It's probably safer to use parse_url() see http://www.php.net/function.parse-url
C.
Navigation:
[Reply to this message]
|