Re: Hoe to get file name?
| From: | Gonzalo Vera | Date: | Thu, 26 Oct 2000 21:25:04 +0000 |
| Subject: | Re: Hoe to get file name? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-3539@lists.php.net to get a copy of this message | ||
How about (untested):
$parts=explode("/",$url);
$file=$parts[sizeof($parts)];
This should return the last exploded element from $url, after the last
"/". Would it work?
Gonzalo.
> Hi all,
> $HTTP_REFERER willl show complete URL.
> $PATH_INFO will show part after server name ($SERVER_NAME).
> $QUERY_STRING - string after sign "?" in URL.
> But, how to get file name from URL
> (i.g. in
> URL="http://www.domanname.com/scripts/test/phpscript.php"
> I need extract phpscript.php)
> Thanks!