Basically I have a file_get_contents that gets json, then I decode the json. My problem is using Foreach() to cycler through all the arrays, it doesn’t seem to be doing it, I’ve made sure the arrays aren’t empty by using print_r(). This script is pretty similar to one I have that works fine, but for some reason this one doesn’t work.
foreach($items['item'] as $ind=>$d2){
$id = $d2['id'];
}
That is my code, I really have no idea why it isn’t working.
PS. I tried doing
$i = 0;
foreach($items[$i] as $ind=>$d2){
$id = $d2['id'];
$i++;
}
And that only got to the 9th array before stopping without error.
Thanks,
Archey
Could you try this one ?
I don’t think you need to fill in that key.
http://php.net/foreach