For Loop in PHP

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>

Output of the Program 


For loop

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment