我有这两个数组:
Array ( [291] => 3 [292] => 1 [293] => 3 )
Array ( [291] => 3 [292] => 1 )
我需要一个php函数来将两者连接起来,结果如下:
Array ( [293] => 3 )
我怎么能这么做?
如果你想计算array_diff,你应该使用array_diff
<?php
$a1=array ( "291" => 3, "292" => 1, "293" => 3 );
$a2=array ( "291" => 3, "292" => 1 ) ;
$result=array_diff_assoc($a1,$a2);
print_r($result);
?>