note 94076 deleted from control-structures.foreach by thiago
| From: | thiago@php.net | Date: | Thu, 15 Oct 2009 10:48:02 +0000 |
| Subject: | note 94076 deleted from control-structures.foreach by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161759@lists.php.net to get a copy of this message | ||
Note Submitter: jon dot gilbert at net-entwicklung dot de
----
megazzt, you probably have a null value, not an empty array. You shouldn't have any problems if
you pass in an array with no values. If you pass in a "null" then it is correct that
foreach is unhappy about that.
You could of course check the variable first with is_array() or empty().