note 39711 added to function.strrchr
| From: | neon at lordneon dot com | Date: | Sun, 08 Feb 2004 13:05:29 +0000 |
| Subject: | note 39711 added to function.strrchr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64824@lists.php.net to get a copy of this message | ||
I just found out an easy way to check if a file is an image or not:
<?php
$ext = strchr($image_type, "image");
if (!$ext) {
die("The selected file is not an image");
} else {
/* Upload the file or whatever you want */
}
?>
Hope this helps.
Cheers!
----
Manual Page -- http://www.php.net/manual/en/function.strrchr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39711
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39711&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39711&report=yes
Search -- http://master.php.net/manage/user-notes.php