Re: $_SERVER['PHP_SELF'] in a included file
| From: | Richard Lynch | Date: | Tue, 27 Feb 2007 22:37:41 +0000 |
| Subject: | Re: $_SERVER['PHP_SELF'] in a included file | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-249529@lists.php.net to get a copy of this message | ||
I don't think it does know, nor care, nor should it...
Why would it need to know that?...
You may find the info you want in a "backtrace" function at
http://php.net/
On Mon, February 26, 2007 8:15 am, clive wrote:
> Thanks Vincent,Stut and Olaf. Thats __file___ is exactly what I needed
> :)
>
> now for another brain teaser for your collective brains, How does a
> function know what file it was called from.
>
> a.php includes functions.php
>
> in a.php we call function test(); which is declared in functions.php
>
> Is there anyway for test(); to echo "called from a.php" with out
> passing 'a.php' or ___FILE___ as a parameter to the function?
>
> Im busy googling now for a answer.
>
> --
> Regards,
>
> Clive.
>
> Real Time Travel Connections
>
>
> {No electrons were harmed in the creation, transmission or reading of
> this email. However, many were excited and some may well have enjoyed
> the experience.}
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?