Here is a simple function which returns the extension of the file.
function
getExtension($str)
{
$i
= strrpos($str,".");
if (!$i) { return ""; }
$l
= strlen($str) - $i;
$ext
= substr($str,$i+1,$l);
return
$ext;
}
No comments:
Post a Comment