note 20331 deleted from function.filetype by sniper
| From: | sniper@php.net | Date: | Fri, 31 Oct 2003 13:36:45 +0000 |
| Subject: | note 20331 deleted from function.filetype by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59585@lists.php.net to get a copy of this message | ||
Note Submitter: andrew@@liststream.dot.com
----
I think this is the easiest way to determine the extension of a file and it works for a file with
any number of (file.tar.zip.gz.txt) periods.
$ext_array =explode(".",$local_file);
$last_position = count($ext_array) - 1 ;
$extension = $ext_array[$last_position] ;