Break out of a while loop in PHP

Description

The following code shows how to break out of a while loop.

Example


<?php// w  ww.j  a  v  a2 s .co  m
  while(TRUE)
  {
    print("This line is printed.");
    break;
    print("This line will never be printed.");
  }
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Language Basic »




PHP Introduction
PHP Operators
PHP Statements
Variable
PHP Function Create
Exception
PHP Class Definition