If you store only booleans, use this:
$a = array('a'=> true, 'b'=> true, 'c'=>true); $af = array_filter($a); if ($af == $a) { echo "all true"; } if (empty($af)) { echo "all false";
}
// $result is now true if any value was true, otherwise it's false// set default value $result = false; foreach ($array as $key => $value) { if ($value === true) { $result = true; break; } }
No comments:
Post a Comment