Once again, use GetImageSize(). The 3rd array element returned by GetImageSize() is the image type. It returns 1 for GIF, and 4 for SWF. The function below will return true if it is either gif or swf.
function gifswf($file) {
$type = GetImageSize($file);
if ($type[2] == 1 || $type[2] == 4) {
return true;
}
}