note 30376 added to reserved.variables
| From: | breaker at coder dot hu | Date: | Sat, 15 Mar 2003 22:31:52 +0000 |
| Subject: | note 30376 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45366@lists.php.net to get a copy of this message | ||
Hi
For those, who need only the script name of $PHP_SELF, that is currently running, here is a little
script that will give ya:
$host=$PHP_SELF;
$i=strlen($host);
while (($stop!=1) and ($i>=0)) {
if ($host[$i] !="/") {
$new = $host[$i].$new;
$i--;
} else $stop=1;
}
$new will contain the name of the current file(ex. test.php) instead of /currentdir/test.php
--
http://www.php.net/manual/en/reserved.variables.php
http://master.php.net/manage/user-notes.php?action=edit+30376
http://master.php.net/manage/user-notes.php?action=delete+30376
http://master.php.net/manage/user-notes.php?action=reject+30376