note 107607 deleted from control-structures.foreach by googleguy
| From: | googleguy@php.net | Date: | Wed, 14 Nov 2012 22:17:07 +0000 |
| Subject: | note 107607 deleted from control-structures.foreach by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191940@lists.php.net to get a copy of this message | ||
Note Submitter: php at keith tyler dot com
----
FYI, as with 'if', braces are not necessary for single statement loops.
For example, the following are equivalent:
<?php
$s=Array("4","8","15","16","23","42");
foreach($s as $q) {
print $q;
}
?>
<?php
$s=Array("4","8","15","16","23","42");
foreach($s as $q) print $q;
?>