mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Added one crossref & fixed the break; section.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@22753 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
197abc4617
commit
10710191e2
1 changed files with 14 additions and 11 deletions
|
@ -91,11 +91,14 @@ if ($a > $b) {
|
|||
}
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
|
||||
The <literal>else</literal> statement is only executed if the
|
||||
<literal>if</literal> expression evaluated to
|
||||
<literal>FALSE</literal>, and if there were any
|
||||
<literal>elseif</literal> expressions - only if they evaluated to
|
||||
<literal>FALSE</literal> as well (see below).
|
||||
<literal>FALSE</literal> as well (see <link
|
||||
linkend="control-structures.elseif">elseif</link>).
|
||||
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
@ -534,28 +537,28 @@ foreach($a as $k => $v) {
|
|||
|
||||
<simpara>
|
||||
<literal>break</literal> ends execution of the current
|
||||
<literal>if</literal>, <literal>for</literal>,
|
||||
<literal>while</literal>, or <literal>switch</literal>
|
||||
structure.
|
||||
<literal>for</literal>, <literal>while</literal>, or
|
||||
<literal>switch</literal> structure.
|
||||
</simpara>
|
||||
|
||||
<simpara>
|
||||
<literal>break</literal> accepts an optional numeric argument
|
||||
which tells it how many nested enclosing structures are to be
|
||||
broken out of.
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
$i = 0;
|
||||
while ($i < 10) {
|
||||
if ($arr[$i] == "stop") {
|
||||
break; /* You could also write 'break 1;' here. */
|
||||
}
|
||||
$i++;
|
||||
$arr = array( 'one', 'two', 'three', 'four', 'stop', 'five' );
|
||||
while ( list( , $val ) = each( $arr ) ) {
|
||||
if ( $val == 'stop' ) {
|
||||
break; /* You could also write 'break 1;' here. */
|
||||
}
|
||||
echo "$val<br>\n";
|
||||
}
|
||||
|
||||
/* Using the optional argument. */
|
||||
|
||||
$i = 0;
|
||||
while ( ++$i ) {
|
||||
switch ( $i ) {
|
||||
|
|
Loading…
Reference in a new issue