Course Content
PHP is an object-oriented scripting programming language that allows web developers to create dynamic and interactive web pages. PHP stands for Hypertext Preprocessor (PHP).
Control Statement
A control statement is a statement that determines whether other statements will be executed.
PHP for Beginners
About Lesson

The while loop executes a block of code repeatedly until the condition is FALSE.


while (condition is true) {
  	code to be executed;


$number = 1;
while($num <= 5) {
  	echo "The number is: $num 
  • $num = 1; – Initialize the loop counter ($num), and set the start value to 1
  • $num <= 5 – Continue the loop as long as $num is less than or equal to 5
  • $num++; – Increase the loop counter value by 1 for each iteration