du7999 2011-11-25 10:05 采纳率: 100%
浏览 155
已采纳

比较php中两个数组的差异

Array ( [34] => A [35] => B [36] => B [37] => C ) //This is the Answer

Compares

Array ( [34] => B [35] => C [36] => A [37] => D ) //This is the right data

I have tried array_diff_key and array_diff functions but both only returns

Array()

I would like to get the count of the difference, is there a faster way?

What did i do wrong? Thank you very much for your help!

  • 写回答

3条回答 默认 最新

  • dongzj2015 2011-11-25 10:07
    关注
    count(array_diff_assoc($array1, $array2));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?