Date: 08/06/00
- Next message: Derick Rethans: "[PHP-DOC] cvs: phpdoc /en/features error-handling.xml"
- Previous message: Rasmus Lerdorf: "[PHP-DOC] www.php.net manual has been updated"
- Next in thread: Egon Schmid ( <email protected>): "Re: [PHP-DOC] foreach and break"
- Reply: Egon Schmid ( <email protected>): "Re: [PHP-DOC] foreach and break"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi!
Ok Egon, this time I switched to the snaps:
http://snaps.php.net/manual/en/html/control-structures.break.html. break
seems to work for foreach() eigther, the manual does not mention this.
$array_data = array ( 1 => "one", 2 => "two", 3 => "three" );
foreach($array_data as $value) {
print "$value<br>";
if ("one" == $value)
break;
}
print "<hr>";
foreach($array_data as $value) {
print "level1, $value<br>";
foreach($array_data as $key => $value) {
print "level2, $value<br>";
if ("one" == $value)
break 2;
}
}
Ulf
- Next message: Derick Rethans: "[PHP-DOC] cvs: phpdoc /en/features error-handling.xml"
- Previous message: Rasmus Lerdorf: "[PHP-DOC] www.php.net manual has been updated"
- Next in thread: Egon Schmid ( <email protected>): "Re: [PHP-DOC] foreach and break"
- Reply: Egon Schmid ( <email protected>): "Re: [PHP-DOC] foreach and break"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

