note 49460 deleted from function.explode by bjori
| From: | bjori@php.net | Date: | Mon, 25 Sep 2006 08:10:49 +0000 |
| Subject: | note 49460 deleted from function.explode by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117594@lists.php.net to get a copy of this message | ||
Note Submitter: woltersware at ish dot de
----
This is a simple way to get the ending of a file using explode
$str_filename = "maisfsd.fdfwadasc.eswfwefwe.rdyxfdasd.asda.sd.asd.JPG";
$dotarray = explode(".",$str_filename);
$fileending = $dotarray[(count($dotarray)-1)];
echo $fileending;
Result: JPG