note 20331 added to function.filetype
| From: | andrew at at liststream dot dot dot com | Date: | Sat, 30 Mar 2002 19:53:49 +0000 |
| Subject: | note 20331 added to function.filetype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-28413@lists.php.net to get a copy of this message | ||
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] ;
--
http://www.php.net/manual/en/function.filetype.php
http://master.php.net/manage/user-notes.php?action=edit+20331
http://master.php.net/manage/user-notes.php?action=delete+20331
http://master.php.net/manage/user-notes.php?action=reject+20331