Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个数组。在 PHP 中
dir(0=>1,1=>2,2=>3,3=>5,4=>7,5=>8); list(0=>1,1=>12,2=>18,3=>20,4=>7,5=>8);
结果数组应该是
result(0=>2,1=>3,2=>5);
结果数组应包含 list() 数组中不存在的值
$diff=array_diff($dir,$lists);