Break Statement : break statement « Statement « PHP

Break Statement

  <title>Break Statement</title>

  $i = 0;

  while ( $i < 6 )
    if( $i == 3) break;
  echo("Loop stopped at $i by break statement");


Related examples in the same category

1.Break statement
2.Breaking a Loop
3.Using the break Statement
4.Break 1 or break 2
5.Using the break Statement
6.The break command applies to both loops and switch/case statements
7.break within a for loop
8.Using break to avoid division by zero