I need to check if all values in an array equal the same thing.
For example:
$allValues = array( \'true\', \'true\', \'true\', );
Another option:
function same($arr) { return $arr === array_filter($arr, function ($element) use ($arr) { return ($element === $arr[0]); }); }
Usage:
same(array(true, true, true)); // => true