Re: problem with foreach

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

 



Also, AFAIK, PHP has always thrown a warning or notice if you use
foreach() on a non-associative array.  That doesn't mean it won't work,
but the strict standard is apparently:

foreach ($assoc as $key => $val)

not

foreach ($indexed as $item)

However, as we all know, the latter still works fine.

Despite the warning/notice you see, the code is probably still working
as expected (any other problems aside).  If you like to keep error
reporting on, you can just use an @ to suppress that error.

-- 
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