note 75107 added to function.substr
| From: | axew3 at w3it dot org | Date: | Sat, 12 May 2007 16:33:44 +0000 |
| Subject: | note 75107 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126462@lists.php.net to get a copy of this message | ||
I want this to get in any case the name of current page and his extension:
$pathF = __FILE__ ;
echo $pathF . '<br />';
echo $totL = strlen($pathF) .'<br />';
echo $posL = strrpos($pathF, "\\") . '<br />';
echo $rest = substr($pathF, $posL + 1, $totL); // return 'wanted.php'. The page file name
and extension
----
Server IP: 69.147.83.197
Probable Submitter: 87.6.185.70
----
Manual Page -- http://www.php.net/manual/en/function.substr.php
Edit -- https://master.php.net/note/edit/75107
Del: integrated -- https://master.php.net/note/delete/75107/integrated
Del: useless -- https://master.php.net/note/delete/75107/useless
Del: bad code -- https://master.php.net/note/delete/75107/bad+code
Del: spam -- https://master.php.net/note/delete/75107/spam
Del: non-english -- https://master.php.net/note/delete/75107/non-english
Del: in docs -- https://master.php.net/note/delete/75107/in+docs
Del: other reasons-- https://master.php.net/note/delete/75107
Reject -- https://master.php.net/note/reject/75107
Search -- https://master.php.net/manage/user-notes.php