note 90333 deleted from function.basename by danbrown
| From: | danbrown@php.net | Date: | Thu, 16 Apr 2009 19:52:35 +0000 |
| Subject: | note 90333 deleted from function.basename by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153401@lists.php.net to get a copy of this message | ||
Note Submitter: raystorm1 [at] gmail [dot] com
----
In response to leelu123 at gmail dot com
You have a good idea, but that only works for a string that leads to a directory and ends in a
'/',
for strings that end in a file name that doesn't work.
However this does:
<?php basename( dirname($file_name_to_check) ); ?>
after pulling out the directory information, basename() treats the final directory like it is a
file, thanks to it not having the file name or a '/' at the end of the string, courtesy of
dirname().