If statement inside a for loop : for loop « Statement « PHP
- PHP
- Statement
- for loop
If statement inside a for loop
<?php
$a = -3;
for (; $a <= 20; $a++){
if ($a == 0){
break;
}
$divide = 40/$a;
echo "The result of dividing 40 by $a is $divide", "<BR>";
}
?>
Related examples in the same category