|
Size: | 8507 |
Storage flags: | no_autoload,compress/gzip (33%) |
Zend\Validator\File\IsImage checks if a file is an image, such as jpg or png. This validator is based on the MimeType validator and supports the same methods and options.
The default list of image file MIME types can be found in the source code.
Please refer to the MimeType validator for options and public methods.
1 2 3 4 | $validator = new \Zend\Validator\File\IsImage();
if ($validator->isValid('./myfile.jpg')) {
// file is valid
}
|
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.