note 23394 added to function.basename
| From: | harry at ilo dot de | Date: | Wed, 17 Jul 2002 12:55:32 +0000 |
| Subject: | note 23394 added to function.basename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33205@lists.php.net to get a copy of this message | ||
In reply to: jsteele@snl.com
You could also use a regexp to do that:
function getext($filename)
{ return preg_replace("/^(.*\.)(\w*)$/", "\\2", $filename); }
--
http://www.php.net/manual/en/function.basename.php
http://master.php.net/manage/user-notes.php?action=edit+23394
http://master.php.net/manage/user-notes.php?action=delete+23394
http://master.php.net/manage/user-notes.php?action=reject+23394