当前位置 : 主页 > 网络编程 > PHP >

判断是否真实gif图.txt

来源:互联网 收集:自由互联 发布时间:2021-06-28
判断是否真实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
判断是否真实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('gif.gif');
网友评论