break stops execution of the current for, foreach, while, do-while or switch structure.

Syntax: break;

Example:
Code:

$name = array('Tom', 'Ross',   'Smith',  'Taylor','Mahanama', 'Harsha');
while (list(, $val) = each($name)) {
    if ($val == 'Taylor') {
        break;    
    }
    echo "$val
\n"; }

Output:

Tom
Ross
Smith

eXTReMe Tracker