Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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)) {

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #check #array #values
ADD COMMENT
Topic
Name
2+7 =