Re: PHP equivalent to Perl $0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/31/07, Richard Luckhurst <rluckhurst@xxxxxxxxxxxxx> wrote:
Hi

In Perl there is the predefined $0 which contains the name of the file
containing the Perl script being executed. Is there an equivalent in PHP?

I am working on converting a Listener script from Perl to PHP and at one point
when the script forks it has a line

$0 = "Listener is accepting connections on Port $port";

When this Perl script is running and I do a ps I see a process ID with the
program being

Listener is accepting connections on Port $port

instead of the actual name of the Perl script.

Is such a thing possible in PHP? If so how? I have been Google searching for a
while and can not see one way or the other if it is possible.



Regards,
Richard Luckhurst
Product Development
Exodus Systems - Sydney, Australia.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


__FILE__ contains the full path and filename of the file on the
filesystem.  There are several $_SERVER indices that give something
you can get the filename/path from as well.  See
http://us2.php.net/manual/en/reserved.variables.php

--
Kevin Jordan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux