note 88066 added to function.move-uploaded-file
| From: | (php@genjo.fr) | Date: | Thu, 08 Jan 2009 14:08:01 +0000 |
| Subject: | note 88066 added to function.move-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148946@lists.php.net to get a copy of this message | ||
sedativchunk post a method to find the extension of the file uploaded; but if the extension is more
than 3 characters it won't work :
<?php
$file_type = 'hello.world.JPEG';
$file_type_length = strlen($file_type) - 3;
echo substr($file_type, $file_type_length); //Will return PEG
?>
Instead you can use :
<?php
echo strrchr('hello.world.JPEG', '.'); //Will return .JPEG
?>
Best regards
Johan
----
Server IP: 89.31.146.176
Probable Submitter: 82.235.19.195
----
Manual Page -- http://www.php.net/manual/en/function.move-uploaded-file.php
Edit -- https://master.php.net/note/edit/88066
Del: integrated -- https://master.php.net/note/delete/88066/integrated
Del: useless -- https://master.php.net/note/delete/88066/useless
Del: bad code -- https://master.php.net/note/delete/88066/bad+code
Del: spam -- https://master.php.net/note/delete/88066/spam
Del: non-english -- https://master.php.net/note/delete/88066/non-english
Del: in docs -- https://master.php.net/note/delete/88066/in+docs
Del: other reasons-- https://master.php.net/note/delete/88066
Reject -- https://master.php.net/note/reject/88066
Search -- https://master.php.net/manage/user-notes.php