note 18499 added to function.filetype
| From: | hantzley at intnet dot mu | Date: | Fri, 25 Jan 2002 11:04:32 +0000 |
| Subject: | note 18499 added to function.filetype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-25809@lists.php.net to get a copy of this message | ||
When trying to find the extension of a file do not simply do :
$strs = explode(".",$userfile_name);
$extension = $strs[1];
This will not work with files such as :
test.tar.gz , etc.
Its better you use:
$strs = explode(".",$userfile_name);
$count= count($strs);
$extension = ".".$strs[$count-1];
--
http://www.php.net/manual/en/function.filetype.php
http://master.php.net/manage/user-notes.php?action=edit+18499
http://master.php.net/manage/user-notes.php?action=delete+18499
http://master.php.net/manage/user-notes.php?action=reject+18499