Welcome Guest, Not a member yet? Register   Sign In
foreach error
#3

[eluser]BrianDHall[/eluser]
To elucidate:

Code:
<?php foreach ($item['random_single'] as $item): ?>
<?php foreach ($item['list_category'] as $item): ?>

You are over-writing your $item[] array with a scalar $item, thus the unexpected behavior. If the first foreach runs then the second can't because $item['list_category'] doesn't exist - at that point $item is not an array and has no such element.


Messages In This Thread
foreach error - by El Forum - 10-19-2009, 04:24 AM
foreach error - by El Forum - 10-19-2009, 04:28 AM
foreach error - by El Forum - 10-19-2009, 08:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB