Re: Mystery foreach error
| From: | Jim Giner | Date: | Tue, 12 Mar 2013 20:06:01 +0000 |
| Subject: | Re: Mystery foreach error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-320497@lists.php.net to get a copy of this message | ||
On 3/12/2013 3:45 PM, Angela Barone wrote:
$zip_short = substr($zip, 0, 3);
foreach ($states[$state] as &$zip_prefix) { // <-- line 377
if ($zip_prefix == $zip_short) {
break;
} else {
$match = 'no';
}
}
I see the & in the foreach. Since you are not modifying anything in the array, why are you using that?
Also - I'm assuming that $states is a multi-dimensional array?