Answers for "php same values count as 1 array"

PHP
0

php check if all array values are the same

// All values are equal
if (count(array_unique($allvalues)) === 1 && end($allvalues) === 'true') {

}

// Check the thing you don't want
if (in_array('false', $allvalues, true)) {

}
Posted by: Guest on December-22-2020

Browse Popular Code Answers by Language