本文整理匯總了PHP中Diff::getMd5方法的典型用法代碼示例。如果您正苦於以下問題:PHP Diff::getMd5方法的具體用法?PHP Diff::getMd5怎麽用?PHP Diff::getMd5使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Diff
的用法示例。
在下文中一共展示了Diff::getMd5方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: save
public function save()
{
file_put_contents('checksum' . time() . '.txt', json_encode($this->fileArr));
}
}
function arrayRecursiveDiff($aArray1, $aArray2)
{
$aReturn = array();
foreach ($aArray1 as $mKey => $mValue) {
if (array_key_exists($mKey, $aArray2)) {
if (is_array($mValue)) {
$aRecursiveDiff = arrayRecursiveDiff($mValue, $aArray2[$mKey]);
if (count($aRecursiveDiff)) {
$aReturn[$mKey] = $aRecursiveDiff;
}
} else {
if ($mValue != $aArray2[$mKey]) {
$aReturn[$mKey] = $mValue;
}
}
} else {
$aReturn[$mKey] = $mValue;
}
}
return $aReturn;
}
$oldArr = json_decode(file_get_contents("/var/www/html/checksum1447659829.txt"), true);
$diff = new Diff('/var/www/html/rock/');
$newArr = $diff->getMd5();
$diff->save();
print_r(arrayRecursiveDiff($newArr, $oldArr));