There is such a json answer
{ "ok": true, "result": { "total_count": 14, "photos": [[{ "file_id": "AgADAgAD6qcxGwyaYxMulue7xCVvITMmrQ4ABKwFQfa_ML0d0qQBAAEC", "file_size": 4367, "width": 160, "height": 160 }, { "file_id": "AgADAgAD6qcxGwyaYxMulue7xCVvITMmrQ4ABBYsR-VFYPb806QBAAEC", "file_size": 14094, "width": 320, "height": 320 }, { "file_id": "AgADAgAD6qcxGwyaYxMulue7xCVvITMmrQ4ABOlO5fHuDpog1KQBAAEC", "file_size": 47984, "width": 640, "height": 640 }]] } } I have this function
function getUserProfilePhotos($chat_id) { $photo_array = json_decode(file_get_contents($GLOBALS['api'] . '/getUserProfilePhotos?user_id=' . $chat_id . '&limit=1'), TRUE); $photo_id = $photo_array['result']['photos'][1]['file_id']; return $photo_id; } How can I make her return the third file_id in the list, there are several of them, we need the third