Hello,
How do I get the filename or script name if I run it in php comamnd line? For
example, if I run this
bash$ php test.php
I want to get something inside test.php that tells me the filename is
test.php, but *without* the actual path.
Thanks
Reuben D. Budiardja
--
PHP General Mailing
7:48 AM
Subject: [PHP] Get filename in php command line
Hello,
How do I get the filename or script name if I run it in php comamnd line?
For
example, if I run this
bash$ php test.php
I want to get something inside test.php that tells me the filename is
test.php, but *without* the actual path
, and it's only 4
lines. :)
JB
- Original Message -
From: Reuben D Budiardja [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 7:48 AM
Subject: [PHP] Get filename in php command line
Hello,
How do I get the filename or script name if I run it in php comamnd
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
7 matches
Mail list logo