Re: Mystery foreach error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux