开发者

Find whats the same in two arrays

开发者 https://www.devze.com 2023-04-09 09:53 出处:网络
I have two arrays: 1) Array ( [0] =>开发者_开发知识库; 162 [1] => 163 [2] => 98 [3] => 13

I have two arrays:

1)

Array ( 
    [0] =>开发者_开发知识库; 162 
    [1] => 163 
    [2] => 98 
    [3] => 13
)

2)

Array (
    [0] => 22
    [1] => 45
    [2] => 163
    [3] => 80
)

I want to find which values are the same in the these two arrays:

So that $thesame = 163 in this example

Thanks.


Try array_intersect() ...

http://uk3.php.net/manual/en/function.array-intersect.php

0

精彩评论

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