if(count(array_unique($array)) === 1) { // all values in $array are the same } else { // at least 1 value in $array is different }