note 129054 added to function.exif-imagetype

From: Date: Sun, 19 Nov 2023 02:06:12 +0000
Subject: note 129054 added to function.exif-imagetype
Groups: php.notes 
Request: Send a blank email to php-notes+get-221008@lists.php.net to get a copy of this message
Can I Use the function to check somefile is a valid image? Yes! try it ```php function isImage($filename) { try { exif_imagetype($filename); return true }catch (Error as $e) { return false } } ``` ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.157.134 (proxied: 101.86.106.213) ---- Manual Page -- https://php.net/manual/en/function.exif-imagetype.php Edit -- https://main.php.net/note/edit/129054 Del: integrated -- https://main.php.net/note/delete/129054/integrated Del: useless -- https://main.php.net/note/delete/129054/useless Del: bad code -- https://main.php.net/note/delete/129054/bad+code Del: spam -- https://main.php.net/note/delete/129054/spam Del: non-english -- https://main.php.net/note/delete/129054/non-english Del: in docs -- https://main.php.net/note/delete/129054/in+docs Del: other reasons-- https://main.php.net/note/delete/129054 Reject -- https://main.php.net/note/reject/129054 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221008) next »