Katie Binks
0
Q:

php loop statement


<?php 
for ($x = 0; $x <= 10; $x++)
{

   echo "The number is: $x <br>";
} 
?>  
13
/*
For loop in php
*/

<?php
for ($i = 0; $i < 10; $i++) {
     echo $i."<br>";
} 
?>
5

for (init counter; test counter; increment counter)
{

  code to be executed 
  for each iteration;

}
2
do
{
    code to be executed
}
while (condition)
0

New to Communities?

Join the community