What I use:
$raw = file_get_contents('url');
$raw = json_decode($raw,true);
foreach($raw['data'] as $spell){
var_dump($spell);
}
What I get:
array(1) {
["image"]=> array(2){
["w"]=> int(48)
["h"]=> int(48)
}
}
For now everything is fine.
But when I use a second loop (because of more than 1 keys & values) like this:
foreach ($raw['data'] as $spell){
foreach ($spell['image'] as $image) {
var_dump($image);
}
}
I get:
int(48) int(48)
Nothing else.
I expected to get:
array(2){
["w"]=> int(48)
["h"]=> int(48)
}
What am i doing wrong?