PHP 数组函数 array_diff()、array_merge() 与数组操作符 +
array_diff() 函数是以值为判断依据,比如<?use Libs\Helper;include '../vendor/autoload.php';$a = array(0 => '1760', 1 => '1199', 2 => '4188', 3 => '1552', 4 => '6388',);$b = array(1760, 9999, '8999');Helper::p(array_diff($a, $b));Helper::p(array_diff($b, $a));输出Arra[1] => 1[2] => 4[3] => 1[4] => 6Arra[1] => 9[2] => 8同样,array_merge 函数也是以值为判断依据进行合并数组,如下<?use Libs\Helper;include '../ven... Read More