Reputation: 42139
I have a multidimensional array, that is a few levels deep. I am trying to loop through some of the lower levels of array items, but when I do, it seems to only return one of the array items.
foreach ($items as $item) {
foreach ($item as $id) {
echo $id;
}
}
For some reason, echoing $id only returns the first item in the $item array, how would I look through all items in the $item array, and echo those as well?
Upvotes: 1
Views: 405
Reputation: 1047
First, are you totally sure it is a multidimensional array? I'd try to check my $items structure using
print_r($items)
Upvotes: 2