<?php
function check_animated($filename) {
$filecontents=file_get_contents($filename);
if(substr_count($filecontents,"\x00\x21\xF9\x04") > 1) {
return true;
} else {
return false;
}
}
// 2 Voorbeelden
$file_animated = "file_animated.gif";
$file_flat = "file_flat.gif";
if (check_animated($file_animated)) {
echo $file_animated." is animated <br/>";
} else {
echo $file_animated." is not animated <br/>";
}
if (check_animated($file_flat)) {
echo $file_flat." is animated <br/>";
} else {
echo $file_flat." is not animated <br/>";
}
<?php
function check_animated($filename) {
return true;
} else {
return false;
}
}
// 2 Voorbeelden
$file_animated = "file_animated.gif";
$file_flat = "file_flat.gif";
if (check_animated($file_animated)) {
echo $file_animated." is animated <br/>"; } else {
echo $file_animated." is not animated <br/>"; }
if (check_animated($file_flat)) {
echo $file_flat." is animated <br/>"; } else {
echo $file_flat." is not animated <br/>"; }