note 8629 added to basename
| From: | peter at helpnet dot com dot au | Date: | Thu, 21 Sep 2000 17:58:49 +0000 |
| Subject: | note 8629 added to basename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-5312@lists.php.net to get a copy of this message | ||
if you are confused by the results of using basename() or dirname, see http://www.helpnet.com.au/php/
There are a few too many examples to copy in to here.
basename() selects what it thinks is a file name including simple directory names. dirname() selects
what it thinks is a path including simple file names. You need to either account for the exceptions
or perform your own split of the file reference/url.
Accounting for the exceptions could include using one of the file functions to check if the result
is a file.
http://www.php.net/manual/function.basename.php