PHP数组函数array_diff()、array_merge()与数组操作符+

array_diff()函数是以值为判断依据,比如[code lang="php"use Libs\Helper;include '../vendor/autoload.php';$a = array 0 => '1761 => '1192 => '4183 => '1554 => '638);$b = array(1760, 9999, '8999');Helper::p(array_diff($a, $b));Helper::p(array_diff($b, $a));[/code输出[code lang="php"Arra[1] => 1[2] => 4[3] => 1[4] => 6Arra[1] => 9[2] => 8[/code同样,array_merge函数也是以值为判断依据进行合并... Read More