$PHP_SELF returns the filename with the full path. from there, you can use
split to split the string wherever a / occurs, then call count, to get the
total number of values in the array, decrememnt the count by 1 (Arrays begin
at 0) then, set a variable to store just the filename, like so:
Seems that $PHP_SELF is not defined when it's run from the command line.
Reuben D. Budiardja
On Tuesday 17 July 2001 10:29 am, Jason Bell wrote:
$PHP_SELF returns the filename with the full path. from there, you can use
split to split the string wherever a / occurs, then call count, to get
Seems that $PHP_SELF is not defined when it's run from the
command line.
Try:
__FILE__
Chris
I had that before.
OK, seems that my problem is not that simple. The thing is , I have something
like this in my file test.php:
require('my_api.inc');
echo This is test.php3;
Now, in my_api.inc, I want to know that I run test.php3, when I do
bash$ php test.php3
and the filename is test.php3
I had that before.
OK, seems that my problem is not that simple. The thing is ,
I have something
like this in my file test.php:
require('my_api.inc');
echo This is test.php3;
Now, in my_api.inc, I want to know that I run test.php3, when I do
bash$ php test.php3
and the filename is
On Tuesday 17 July 2001 11:14 am, Boget, Chris wrote:
in my_api.inc, have the following code:
echo Currently Running file is: ;
echo ( $CurrentRunningFile ) ? $CurrentRunningFile : __FILE__;
in test.php
?
$CurrentRunningFile = __FILE__;
include( my_api.inc );
echo This is
6 matches
Mail list logo