For example, add 1 to 100 up:
<?PHP $sum = 0; for ($ii=1; $ii<100; $ii++) { $sum += $ii; } echo "$sum";?>
Also, function
<?PHP $arr = array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"); foreach($arr as $d) { echo "$d\n"; }?>
For associative array:
<?PHP $arr = array("one"=>"Monday","two"=>"Tuesday","three"=>"Wednesday", "four"=>"Thursday","five"=>"Friday","six"=>"Saturday","seven"=>"Sunday"); foreach($arr as $num=>$d) { echo "$num, $d\n"; }?>
Use
<?PHP for ($i=0;$i<10;$i++) { if ($i % 3 == 0) continue; echo "$i, "; //1, 2, 4, 5, 7, 8, } for ($i=0;$i<10;$i++) { if ($i == 4) break; echo "$i, "; //0, 1, 2, 3, } ?>