For any queries you can reach us at infovistarindia@gmail.com / WhatsApp us: +919158876092

PHP do-while loop

Overview

The do-while loop performs a segment of code repeatedly until the condition is FALSE. The do-while loop is confirmed to run at least once.

Syntax:

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

Example:

$num = 1;
do {
  	echo "The number is: $num 
"; $num++; } while($num <= 5);