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$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}