1 || $age < 100000) && ($height > 1 || $height < 10000000)) { $cnt = 0; foreach ($candles as $candle) { if ($candle === $height) { $cnt++; } } echo $cnt; } else { echo 'candles or age are not correct'; } ?>