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

PHP break

Overview

The PHP break statement terminates the current execution of for, while, do-while, switch, and for-each loop. The break keyword instantly ends the execution of the loop or switch statement.

Example:

for ($num = 0; $num < 10; $num++) {
  	if ($num == 5) {
    		break;
  	}
  	echo "The number is: $num <br>";
}