note 23312 deleted from control-structures.foreach by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 18 Aug 2004 19:31:26 +0000 |
| Subject: | note 23312 deleted from control-structures.foreach by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74912@lists.php.net to get a copy of this message | ||
Note Submitter: javNOSPAM at NOSPAMzero dot org
----
It is not mentioned in the doc, but a foreach sentence can be stopped with break.
Ex. // result from mysql_fetch_row()
foreach ($recs as $id=>$rec) {
if($id=="5") {
break;
} else {
print .....
}
hope it helps.