1if(count(array_unique($array)) === 1) {
2 // all values in $array are the same
3} else {
4 // at least 1 value in $array is different
5}
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}
1$allvalues = array('true', 'true', 'true');
2if (count(array_unique($allvalues)) === 1 && end($allvalues) === 'true') {
3}
1if(count(array_unique($array, SORT_REGULAR)) < count($array)) {
2 // $array has duplicates
3} else {
4 // $array does not have duplicates
5}