PHP - break statement: break

used for the immediate interruption of the loop. after execution, will proceed with the following command after loop.

break

Description

break ;
Used keywords: break

Examples

PHP

even one example in what situations we can use the operation break statement:
$i=10;
do --$i; while ( $i > 0);
do {
  $i++;
  if ($i==5)
    break;
} while ( $i <10);

PHP

Other pieces of example codes:
if ($i==10)
     break;
   else 
   {
     $i--;
   }
Languages: en hu cz sk