note 109098 rejected from function.getimagesize by googleguy
| From: | googleguy@php.net | Date: | Wed, 05 Sep 2012 13:27:34 +0000 |
| Subject: | note 109098 rejected from function.getimagesize by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190518@lists.php.net to get a copy of this message | ||
Note Submitter: Joseph Garbett
----
If your code fails, you are returned an Warning.
<?php $pictureinfo = getimagesize('baghlbgfldfgdfgdfg.jpg'); ?>
PHP Warning: getimagesize(baghlbgfldfgdfgdfg.jpg): failed to open stream: No such file or directory
in index.php on line 89
By var_dump($pictureinfo), you get bool(false).
You can then detect a failed attempt by using:
<?php
if($pictureinfo == false) {
}
?>