Question: php check all array values are the same?
Answer: To check if all elements in an array are the same, should be as simple as: $allValuesAreTheSame = (count(array_unique($allvalues)) === 1); This should work regardless of the type of values in the array.