我正在尝试使用array_diff.这是我的两个数组输出:
列表1输出
Array ([0] => 0022806 )
清单2输出
Array ([0] => 0022806 [1] => 0023199 )
$diff = array_diff($list_1,$list_2); print "DIFF: " . count($diff) ."<br>"; print_r($diff);
输出是:
DIFF: 0 Array ( )
知道我做错了什么吗?
array_diff()中的参数顺序很重要
原文链接:https://www.f2er.com/php/135562.htmlReturns an array containing all the entries from array1 that are not present in any of the other arrays