Re: URL parsing
| From: | gamin | Date: | Thu, 19 Dec 2002 05:56:57 +0000 |
| Subject: | Re: URL parsing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128809@lists.php.net to get a copy of this message | ||
Hi Mako,
if your URL is going to have this format consistently try this
$data = explode("/",$URL);
$user = $data[3];
HTH (untested code)
gamin.
"Mako Shark" <phpman2000@yahoo.com> wrote in message
news:20021218143951.21196.qmail@web14609.mail.yahoo.com...
> I've got a URL like this:
>
> http://www.naturalist.com/~fungae/index.php
>
> which is stored in $http_referer (as parse_url from
> $HTTP_REFERER).
>
> I'm trying to extract the username (~fungae). I've
> read the docs on parse_url(), and have tried to get
> $http_referer[user], but it comes up with zilch. I've
> also tried to print_r $http_referer, but I only get
> scheme, host, path, and query. Any ideas?
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com