$hash = ''
$dir = new RecursiveDirectoryIterator($dir)
foreach(new RecursiveIteratorIterator($dir) as $file) {
$hash .= md5_file($file)
}
return md5($hash)
}
?>
function file_read_all ($dir){
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
$n=0
while (($file = readdir($dh)) !== false) {
if ( $file == '.' or $file =='..' or $file=='.svn')
{
continue
}
echo md5_file($dir.$file)//计算每个文件md5值 echo '<br />'
if (is_dir ($dir.$file))
{
file_read_all ($dir.$file.'/')
}
}
}
closedir($dh)
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)