Loops are used to repeat the same pattern as per user requirements. This program is simple intro of For Loop in PHP Syntax.
Source Code
<html> <head> <title>For Loops Php </title> </head> <body> <?php echo "<br />"; echo " For Loop _ 1 : "; echo "<br />"; echo "<br />"; for ($Numbers=0; $Numbers <= 10; $Numbers++) { echo $Numbers . ", "; } echo "<br />"; echo "<br />"; echo " For Loop _ 2 : "; echo "<br />"; echo "<br />"; for ($Numbers=10; $Numbers <= 20; $Numbers++) { echo $Numbers . ", "; } echo "<br />"; echo "<br />"; echo " For Loop _ 3 : "; echo "<br />"; echo "<br />"; for ($Numbers=20; $Numbers <= 30; $Numbers++) { echo $Numbers . ", "; } echo "<br />"; echo "<br />"; echo " For Loop _ 4 : "; echo "<br />"; echo "<br />"; for ($Numbers=30; $Numbers <= 40; $Numbers++) { echo $Numbers . ", "; } ?> </body> </html>
0 comments:
Post a Comment