$c = sizeof($array);$i = 0;$ok = true;while ($i < $c){ if ($array[$i] <= 2) { $ok=false; break; } ++$i;}if ($ok === true){ // ...}