This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP Loops

The PHP while Loop

The number is: 0
The number is: 10
The number is: 20
The number is: 30
The number is: 40
The number is: 50
The number is: 60
The number is: 70
The number is: 80
The number is: 90
The number is: 100

<?php  
// Initialize the loop counter ($x), and set the start value to 0
$x = 0;

// Continue the loop as long as $x is less than or equal to 100 
while($x <= 100) {
  echo "The number is: $x <br>";
  $x+=10;
}
?>

Example Explained