Loading... - 在一些个人的图床或者网盘中,被一些相同的文件刷存储空间总是感觉很不爽,我们可以通过比较MD5与sha1的方式来检测文件是否重复 - 检测方法如下 ``` public function checkFileToRepeat($file1,$file2) { $md5_1 = md5_file($file1); $md5_2 = md5_file($file2); $sha1_1 = sha1_file($file1); $sha1_2 = sha1_file($file2); if($md5_1 == $md5_2) { if($sha1_1 == $sha1_2) { return true; } } return false; } ``` Last modification:July 4, 2020 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 1 如果觉得我的文章对你有用,请随意赞赏