El código es el siguiente:
{
"ok":true,
"result":{
"total_count":10,
"photos":[
[
{
"file_id":"AgADAQADyKcxG2fzJBevk8tOwCpnuY8AAQswAAS5FWhCNSvhf39MAgABAg",
"file_size":14121,
"width":160,
"height":160
},
{
"file_id":"AgADAQADyKcxG2fzJBevk8tOwCpnuY8AAQswAAQFvpM-NxlHMoBMAgABAg",
"file_size":44240,
"width":320,
"height":320
},
{
"file_id":"AgADAQADyKcxG2fzJBevk8tOwCpnuY8AAQswAAQwCWeX2xsWvIFMAgABAg",
"file_size":131464,
"width":640,
"height":640
}
],
[
{
"file_id":"AgADAQADx6cxG2fzJBczDLnvCwABK3n4cQwwAARwmzHH04Pg5vBbAwABAg",
"file_size":13986,
"width":160,
"height":160
},
{
"file_id":"AgADAQADx6cxG2fzJBczDLnvCwABK3n4cQwwAAR1wBtIIyQ8gfFbAwABAg",
"file_size":43667,
"width":320,
"height":320
},
{
"file_id":"AgADAQADx6cxG2fzJBczDLnvCwABK3n4cQwwAAQB7SsLcIovIPJbAwABAg",
"file_size":129783,
"width":640,
"height":640
}
],
[
{
"file_id":"AgADAQADxqcxG2fzJBcPGd6XVP3GErAZFDAABNnQowUi8XHPNcMAAgI",
"file_size":13978,
"width":160,
"height":160
},
{
"file_id":"AgADAQADxqcxG2fzJBcPGd6XVP3GErAZFDAABA8c8hgTk_LqNsMAAgI",
"file_size":44266,
"width":320,
"height":320
},
{
"file_id":"AgADAQADxqcxG2fzJBcPGd6XVP3GErAZFDAABDBu0q-HHAtcN8MAAgI",
"file_size":133055,
"width":640,
"height":640
}
],
[
{
"file_id":"AgADAQADtqcxG2fzJBfIJ8uP5OSdNCm-CjAABC-k3Hv7H2EXrMAAAgI",
"file_size":12967,
"width":160,
"height":160
},
{
"file_id":"AgADAQADtqcxG2fzJBfIJ8uP5OSdNCm-CjAABLvQS3K_RTlTrcAAAgI",
"file_size":34790,
"width":320,
"height":320
},
{
"file_id":"AgADAQADtqcxG2fzJBfIJ8uP5OSdNCm-CjAABJheLz-2o164rsAAAgI",
"file_size":92836,
"width":640,
"height":640
}
],
[
{
"file_id":"AgADAQADtKcxG2fzJBfacbvzlSjBqqT7CjAABCfDugQ729C1zjAAAgI",
"file_size":10797,
"width":160,
"height":160
},
{
"file_id":"AgADAQADtKcxG2fzJBfacbvzlSjBqqT7CjAABNQPokcjjeSezzAAAgI",
"file_size":23675,
"width":320,
"height":320
},
{
"file_id":"AgADAQADtKcxG2fzJBfacbvzlSjBqqT7CjAABIIVZePI8gcX0DAAAgI",
"file_size":66848,
"width":640,
"height":640
}
],
[
{
"file_id":"AgADAQADs6cxG2fzJBc6sK4kodLKmD4lAzAABA1mjPdNwCMoqpECAAEC",
"file_size":9704,
"width":160,
"height":160
},
{
"file_id":"AgADAQADs6cxG2fzJBc6sK4kodLKmD4lAzAABOnq4glL5Dixq5ECAAEC",
"file_size":21532,
"width":320,
"height":320
},
{
"file_id":"AgADAQADs6cxG2fzJBc6sK4kodLKmD4lAzAABGNNGkHUes9mrJECAAEC",
"file_size":59863,
"width":640,
"height":640
}
],
[
{
"file_id":"AgADAQADsqcxG2fzJBfEfOpUKWgkmFpoAzAABE0yohMUX4famXUAAgI",
"file_size":9399,
"width":160,
"height":160
},
{
"file_id":"AgADAQADsqcxG2fzJBfEfOpUKWgkmFpoAzAABGIatU2IXUwBmnUAAgI",
"file_size":25409,
"width":320,
"height":320
},
{
"file_id":"AgADAQADsqcxG2fzJBfEfOpUKWgkmFpoAzAABFnFUmhgtvR7m3UAAgI",
"file_size":73639,
"width":640,
"height":640
}
],
[
{
"file_id":"AgADAQADsKcxG2fzJBczG743DI4JXvosAzAABP8xEnFlL1Y2oWsCAAEC",
"file_size":9477,
"width":160,
"height":160
},
{
"file_id":"AgADAQADsKcxG2fzJBczG743DI4JXvosAzAABFWCVFULlJCdomsCAAEC",
"file_size":20839,
"width":320,
"height":320
},
{
"file_id":"AgADAQADsKcxG2fzJBczG743DI4JXvosAzAABI5SmM4oZGeKo2sCAAEC",
"file_size":58965,
"width":640,
"height":640
}
],
[
{
"file_id":"AgADAQADrqcxG2fzJBd2kMrXqt_iSsFzDDAABH6R1MoQduKhB4EBAAEC",
"file_size":10611,
"width":160,
"height":160
},
{
"file_id":"AgADAQADrqcxG2fzJBd2kMrXqt_iSsFzDDAABEhHlyT8HwZ_CIEBAAEC",
"file_size":22798,
"width":320,
"height":320
},
{
"file_id":"AgADAQADrqcxG2fzJBd2kMrXqt_iSsFzDDAABOTQuongkGnaCYEBAAEC",
"file_size":59571,
"width":640,
"height":640
}
],
[
{
"file_id":"AgADAQADqacxG2fzJBcKJFvxgDeXd264CjAABBbtFH1kxSiAxREAAgI",
"file_size":6943,
"width":160,
"height":160
},
{
"file_id":"AgADAQADqacxG2fzJBcKJFvxgDeXd264CjAABHygb4oena7_xhEAAgI",
"file_size":17946,
"width":320,
"height":320
},
{
"file_id":"AgADAQADqacxG2fzJBcKJFvxgDeXd264CjAABDLjXMgan3EIxxEAAgI",
"file_size":44860,
"width":640,
"height":640
}
]
]
}
}
es en una web ya la codifique
$resultado = file_get_contents($url)
$resultado = json_decode($resultado, TRUE)
El problema es que quisiera recorrer la array "photos" y obtener el file_id de cada uno al intentar hacer
foreach ($resultado as $clave => $valor){
send($clave, $valor);
}
me envia
ok true
result total_count
photos Array
La funcion send($clave, $valor) es la siguiente:
function send($clave, $valor){
print $clave => $valor
}