note 25594 added to function.basename
| From: | ibyte at SPAMMEANDDIEnoxs dot nl | Date: | Sun, 29 Sep 2002 21:02:32 +0000 |
| Subject: | note 25594 added to function.basename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37398@lists.php.net to get a copy of this message | ||
I have a small amendment to darianlassan's 'filename without path and extension'
line:
$filename = current(explode('.', basename($SCRIPT_NAME)));
As it says on the split() page:
"Note that if you don't require the power of regular expressions, it is faster to use
explode(), which doesn't incur the overhead of the regular expression engine."
--
http://www.php.net/manual/en/function.basename.php
http://master.php.net/manage/user-notes.php?action=edit+25594
http://master.php.net/manage/user-notes.php?action=delete+25594
http://master.php.net/manage/user-notes.php?action=reject+25594