note 54042 deleted from function.ltrim by mazzanet
| From: | mazzanet@php.net | Date: | Sat, 23 Jul 2005 03:14:43 +0000 |
| Subject: | note 54042 deleted from function.ltrim by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-92327@lists.php.net to get a copy of this message | ||
Note Submitter: public marcyes com
----
totally messed up the last post, here is a function that will be able to take filenames like
h.a.p.p.p.y.jpg without problems:
//get the extension of the file
function getFileExtension($file){
//get the type of the file:
while(($file_ext = stristr($file,".")) !== false){
$file_ext = substr($file_ext,1);
$file = $file_ext;
}//while
return trim($file);
}//getFileExtension()