note 37073 deleted from function.strrev by nlopess
| From: | nlopess@php.net | Date: | Sun, 04 Jan 2004 11:01:01 +0000 |
| Subject: | note 37073 deleted from function.strrev by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62891@lists.php.net to get a copy of this message | ||
Note Submitter: alexeig@hot.ee
----
fine function for finding filename....
function getScriptName($str){
$str=strrev($str);
$start=strpos($str, "/");
$str=substr($str,0,(strlen($str)-$start));
return ($str=strrev($str));
}
echo getScriptName($PHP_SELF);
OUTPUT:
$PHP_SELF is : /sub/sub/index.php
getScriptName is : index.php