Check if multiple values are all false or all true
if(count(array_unique($your_array)) === 1) return current($your_array);else return;
You could use in_array
Ex. for all true:
if(in_array(false, $array, true) === false){ return true;}else if(in_array(true, $array, true) === false){ return false;}else{ return 'nothing';}
One can use array_product
as demonstrated at php.net in a comment:
$check[] = boolval(TRUE);$check[] = boolval(1);$check[] = boolval(FALSE);$check[] = boolval(0);$result = (bool) array_product($check);// $result is set to FALSE because only two of the four values evaluated to TRUE