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
A project that I work on has a index.php that includes other files
depending on certain requirements.
so index.php includes a.php;
in a.php if you echo $_SERVER['PHP_SELF'] it echos index.php and I
understand why it does this.
But, I want echo the file name of a.php from a.php and I dont
[mailto:[EMAIL PROTECTED]
Sent: Mon 2/26/2007 14:44
To: PHP General List
Subject: [PHP] $_SERVER['PHP_SELF'] in a included file
A project that I work on has a index.php that includes other files
depending on certain requirements.
so index.php includes a.php;
in a.php if you echo $_SERVER['PHP_SELF
clive wrote:
A project that I work on has a index.php that includes other files
depending on certain requirements.
so index.php includes a.php;
in a.php if you echo $_SERVER['PHP_SELF'] it echos index.php and I
understand why it does this.
But, I want echo the file name of a.php from a.php
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
/26/2007 15:15
To: clive
Cc: PHP General List
Subject: Re: [PHP] $_SERVER['PHP_SELF'] in a included file
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
6 matches
Mail list logo