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
1// All values are equal
2if (count(array_unique($allvalues)) === 1 && end($allvalues) === 'true') {
3
4}
5
6// Check the thing you don't want
7if (in_array('false', $allvalues, true)) {
8
9}
1if(count(array_unique($array, SORT_REGULAR)) < count($array)) {
2 // $array has duplicates
3} else {
4 // $array does not have duplicates
5}
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