note 60570 added to function.pathinfo

From: Date: Wed, 11 Jan 2006 10:53:44 +0000
Subject: note 60570 added to function.pathinfo
Groups: php.notes 
Request: Send a blank email to php-notes+get-101544@lists.php.net to get a copy of this message
I wrote this little handy function to check if a file is an image: <?php function IsImage($fln){//controlla l'estensione di un dato file $kinds = array("GIF","JPG","PNG","SWF","PSD", "BMP","TIFF","JPC","JP2","JPX","JB2","SWC", "IFF","WBMP","XBM"); $flnext = pathinfo($fln); if (in_array(strtoupper($flnext['extension']), $kinds)) { return true; }else{ return false; } } ?> Ciao ciao! bye from Italy! ---- Manual Page -- http://www.php.net/manual/en/function.pathinfo.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60570 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60570&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60570&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60570&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60570&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60570&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60570&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60570&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60570&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#101544) next »