开发者

Remove values found in both arrays

What I'm looking to do is compare two arrays and remove values that are found in both arrays.

such that:

Array1
(
    [0] =&开发者_如何学Cgt; 12356
    [1] => 34567
    [2] => 67890
)

Array2
(
    [0] => 12356
    [1] => 66666
    [2] => 22222
)

And the result that I need is

Array3
    (
        [0] => 12356
    )

Wondering if there's a quick way to do this before I build some function to handle it.


$result = array_intersect($arr1, $arr2);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜