Question: check if array values are the same php?
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.