Hi all,
HBow would I easily go about checking if all the values in an array are the same?
Thanks
if(count(array_unique($array)) == 1) echo 'All values of $array are equivalent!';
Hi,
you can try something like
$initvalue = $array[0]; foreach($array as $value) { if ($value != $initvalue) { echo 'All array elements are not the same!'; break; } }