note 33248 added to function.basename
| From: | pulstar at mail dot com | Date: | Fri, 20 Jun 2003 01:26:56 +0000 |
| Subject: | note 33248 added to function.basename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50694@lists.php.net to get a copy of this message | ||
It was better if basename() could cut off any suffix, for example:
$x = basename("filename.ext",".*");
echo $x; // print: filename
By the way, you can use a function like this:
function strlchr($str,$needle=".") {
return str_replace(strrchr($str,$needle),"",$str);
}
----
Manual Page -- http://www.php.net/manual/en/function.basename.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33248
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33248&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33248&report=yes