HELP! .... Invalid argument supplied for foreach()


#1

this is being driving me nuts, do you see something wrong in this line of code?

foreach($PAGES[$cid] as $pid => $pdata)

any help will be welcome.>!


#2

Yes!

Unless you are using a multi-dimensional array.

You are passing a SINGLE value (as specified by $PAGES[$cid]) when you should be passing an ARRAY.

[php]
foreach($PAGES as $pid => $pdata);
[/php]
(also don’t forget the ; at the end


#3

Thanks a lot, peg110… :D


#4

My Pleasure.

Happy coding