background image

        $infos = explode('.', $file);
        $ext = strtolower($infos[count($infos) - 1]);
        return $ext;
    }
}
调用方式如下:
require_once "Imghash.class.php";
$instance = ImgHash::getInstance();
$result = $instance->checkIsSimilarImg('chenyin/IMG_3214.png', 'chenyin/IMG_3212.JPG');
如果$result 值为 true, 则表明 2 个图片相似,否则不相似。