Re: Get the current file name
| From: | DvDmanDT | Date: | Fri, 25 Jul 2003 13:52:09 +0000 |
| Subject: | Re: Get the current file name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-156849@lists.php.net to get a copy of this message | ||
$tmp=split("\\|/",__FILE__);
$s=$tmp[count($tmp)-1];
or something..
--
// DvDmanDT
MSN: dvdmandt@hotmail.com
Mail: dvdmandt@telia.com
"Shaun" <shaun@mania.plus.com> skrev i meddelandet
news:20030725134647.99572.qmail@pb1.pair.com...
> Hi,
>
> due to a current PHP upgrade i am unable to use the following code to get
> the filename of the page:
>
> $s = getenv('SCRIPT_NAME');
>
> I need to get the filename without any avariables attached. For example if
> the URL is
>
> www.mydomain.com/test.php?test=yes
>
> using $s = getenv('PHP_SELF');
>
> returns test.php?test=yes
>
> how can I return just test.php i.e. the filename on its own
>
> Thanks for your help
>
>