كود:
01    function is_animation($filename)02{
03        $contents = file_get_contents($filename);
04        $str_loc =0;
05        $count =0;
06        while ($count < 2) # There is no point in continuing after we find a 2nd frame
07        {
08 
09                $where1 = strpos($contents,"\x00\x21\xF9\x04",$str_loc);
10                if ($where1 === FALSE)
11                {
12                        break;
13                }
14                else
15                {
16                        $str_loc=$where1+1;
17                        $where2=strpos($contents,"\x00\x2C",$str_loc);
18                        if ($where2 === FALSE)
19                        {
20                                break;
21                        }
22                        else
23                        {
24                                if ($where1+8 == $where2)
25                                {
26                                        $count++;
27                                }
28                                $str_loc=$where2+1;
29                        }
30                }
31        }
32 
33        if ($count > 1)
34        {
35                return(true);
36 
37        }
38        else
39        {
40                return(false);
41        }
42}