1function in_array_any($needles, $haystack) {
2 return !empty(array_intersect($needles, $haystack));
3}
4
5echo in_array_any( [3,9], [5,8,3,1,2] ); // true, since 3 is present
6echo in_array_any( [4,9], [5,8,3,1,2] ); // false, neither 4 nor 9 is present
7
1if (in_array('a', $array_under_test) || in_array('b', $array_under_test)) {
2 // Success!
3}
4
1$uniqueKeys = array_unique($list[0])
2
3foreach ($uniqueKeys as $uniqueKey)
4{
5 $v = array_keys($list[0], $uniqueKey);
6
7 if (count($v) > 1)
8 {
9 foreach ($v as $key)
10 {
11 // Work with $list[0][$key]
12 }
13
14 }
15}
16