public function is_image($path){
        if( !file_exists($path) || !($info = getimagesize($path)) ){
            return false;
        }
        return (bool) preg_match("/^image\/(jpeg|png|gif)$/", $info['mime']);
    }
public function is_image($path){
        if( !file_exists($path) || !($info = getimagesize($path)) ){
            return false;
        }
        return (bool) preg_match("/^image\/(jpeg|png|gif)$/", $info['mime']);
    }
public function is_image ( $ path ) { if ( ! file_exists ( $ path ) || ! ( $ info = getimagesize ( $ path ) ) ) { return false ; } return ( bool ) preg_match ( "/^image\/(jpeg|png|gif)$/" , $ info [ 'mime' ] ) ; }
Detect if specified file is image

@param string $path
@return bool
Detect if specified file is image