note 129976 added to control-structures.break
| From: | csdurangodaves@hotmail.com | Date: | Sun, 12 Jan 2025 04:43:34 +0000 |
| Subject: | note 129976 added to control-structures.break | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221791@lists.php.net to get a copy of this message | ||
Here is a simple "break" usage example. In this example i use "break" to stop
the execution of a php foreach statement of an array as i step through the array using the php
"next" command.
<?php
foreach($example_array as $key => $value)
{
if( (int) $value == 1)
{
break;
}else{
next($example_array);
}
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.84.18 (proxied: 167.89.205.175)
----
Manual Page -- https://php.net/manual/en/control-structures.break.php
Edit -- https://main.php.net/note/edit/129976
Del: integrated -- https://main.php.net/note/delete/129976/integrated
Del: useless -- https://main.php.net/note/delete/129976/useless
Del: bad code -- https://main.php.net/note/delete/129976/bad+code
Del: spam -- https://main.php.net/note/delete/129976/spam
Del: non-english -- https://main.php.net/note/delete/129976/non-english
Del: in docs -- https://main.php.net/note/delete/129976/in+docs
Del: other reasons-- https://main.php.net/note/delete/129976
Reject -- https://main.php.net/note/reject/129976
Search -- https://main.php.net/manage/user-notes.php