note 105765 deleted from control-structures.foreach by googleguy
| From: | googleguy@php.net | Date: | Wed, 14 Nov 2012 22:20:54 +0000 |
| Subject: | note 105765 deleted from control-structures.foreach by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191944@lists.php.net to get a copy of this message | ||
Note Submitter: bartosz dot tomczak at barell dot org
----
<?php
foreach (array() as $value){
echo $value; // Prints nothing here
}
?>
The code above always prints nothing, because array() returns empty array. So $value always be empty
and echo has nothing to print - you never know if foreach is in loop.