比较两个数组内容是否相同
function array_isdiff($a,$b){ $ac = count($a); $bc = count($b); if($ac!=$bc){ return true; } $diff = array_merge(array_diff_assoc($a, $b),array_diff_assoc($b, $a)); if(!empty($diff)){ return true; } return false; }
数组合并后比较
function array_isdiff($a,$b){ $ac = count($a); $bc = count($b); if($ac!=$bc){ return true; } $diff = array_merge(array_diff_assoc($a, $b),array_diff_assoc($b, $a)); if(!empty($diff)){ return true; } return false; }
数组合并后比较