note 87937 added to function.basename
| From: | myname87 at gmail dot com | Date: | Wed, 31 Dec 2008 14:12:09 +0000 |
| Subject: | note 87937 added to function.basename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148717@lists.php.net to get a copy of this message | ||
sven_pauli you are wrong
the space is at the beginnung of the string, so '/foo/bar.jpg' will be '
/foo/bar.jpg' and basename will return 'bar.jpg'. if you ltrim it, you will still
have 'bar.jpg' but substr will return 'ar.jpg'; the substr-method works only if
you have the basename already and in this case the use of basename is unnecessary ;)
----
Server IP: 212.124.37.9
Probable Submitter: 86.56.118.230
----
Manual Page -- http://www.php.net/manual/en/function.basename.php
Edit -- https://master.php.net/note/edit/87937
Del: integrated -- https://master.php.net/note/delete/87937/integrated
Del: useless -- https://master.php.net/note/delete/87937/useless
Del: bad code -- https://master.php.net/note/delete/87937/bad+code
Del: spam -- https://master.php.net/note/delete/87937/spam
Del: non-english -- https://master.php.net/note/delete/87937/non-english
Del: in docs -- https://master.php.net/note/delete/87937/in+docs
Del: other reasons-- https://master.php.net/note/delete/87937
Reject -- https://master.php.net/note/reject/87937
Search -- https://master.php.net/manage/user-notes.php