如何使用PHP计算文件的MD5值

如题所述

function getAllFileMd5($dir){
$hash = '';
$dir = new RecursiveDirectoryIterator($dir);
foreach(new RecursiveIteratorIterator($dir) as $file) {
$hash .= md5_file($file);
}
return md5($hash);
}
?>
温馨提示:答案为网友推荐,仅供参考