判断是否真实gif图.txt function check_gif ($path) { $fh = fopen($path, 'rb'); $str = fread($fh, 1024); //读取1024个字节 fclose($fh); return strpos($str,chr(0x21).chr(0xff).chr(0x0b).'NETSCAPE2.0') === FALSE?0:1;}echo check_gif('g
function check_gif ($path) { $fh = fopen($path, 'rb'); $str = fread($fh, 1024); //读取1024个字节 fclose($fh); return strpos($str,chr(0x21).chr(0xff).chr(0x0b).'NETSCAPE2.0') === FALSE?0:1; } echo check_gif('gif.gif');