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
> :)
>
>
sy.be
>
>
>
> -Original Message-
> From: clive [mailto:[EMAIL PROTECTED]
> Sent: Mon 2/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
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
cipal Consultant OpenSource Competence Center
Ausy Belgium
http://www.ausy.be
-Original Message-
From: clive [mailto:[EMAIL PROTECTED]
Sent: Mon 2/26/2007 15:15
To: clive
Cc: PHP General List
Subject: Re: [PHP] $_SERVER['PHP_SELF'] in a included file
Thanks Vincent,Stut
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
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
hello,
try with the system constant __FILE__
print(__FILE__);
inside a.php should always return a.php, even though this is included into
index.php.
Vincent Dupont
Principal Consultant OpenSource Competence Center
Ausy Belgium
http://www.ausy.be
-Original Message-
From: clive [mail
7 matches
Mail list logo