note 23706 deleted from function.basename by spic
| From: | spic@php.net | Date: | Tue, 17 Sep 2002 09:06:01 +0000 |
| Subject: | note 23706 deleted from function.basename by spic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-36779@lists.php.net to get a copy of this message | ||
In reply to: jsteele@snl.com and the answer by harry@ilo.de
Your reg_exp will only allow extensions consisting of only chars (\w) - what about .mp3?
I usually use:
function getext($filename)
{
if(preg_match("/^.*\.(.+)$/si",$filename,$tmp))
return $tmp[1];
else
return false;
}
and never encountered any problems.
Hope that helps-
Oliver