regarding note from rehfeld dot us :
In my experience the best( and easiest ) way to find the
extension of a file is :
<?php
// use this when you are sure it actually has an extension.
$extension = end(explode(".", $file_name));
?>
or
<?php
// this one will also check if it actually has an extension
$parts = explode(".", $file_name);
if (is_array($parts) && count($parts) > 1)
$extension = end($parts);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 85.186.102.76
----
Manual Page -- htt
p://www.php.net/manual/en/function.is-file.php
Edit -- https://master
.php.net/note/edit/76030
Del: integrated -- h
ttps://master.php.net/note/delete/76030/integrated
Del: useless -- http
s://master.php.net/note/delete/76030/useless
Del: bad code -- htt
ps://master.php.net/note/delete/76030/bad+code
Del: spam -- https:/
/master.php.net/note/delete/76030/spam
Del: non-english --
https://master.php.net/note/delete/76030/non-english
Del: in docs -- http
s://master.php.net/note/delete/76030/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/76030
Reject -- https://mast
er.php.net/note/reject/76030
Search -- https://
master.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|