While Loop:
While loop is an important feature which is used for simple iteration logics. It is checking the condition whether true or false. It executes the loop if specified condition is true.
Syntax:
while (condition is true) {
code to be executed;
}
Example:
<?php
$Student_count = 10;
$student_number = 1;
while($student_number< = $Student_count)
{
echo “The student number is: $student_number
<br>";
$student_number++;
}
?>