skip to Main Content

how can i extract this part of my JSON response – Telegram API

i can extract user id from JSON response,i get response from telegram bot API, but i can not extract file_id. here is my code: <?php $response='{"ok":true,"result":[{"update_id":514191839,"message":{"message_id":898,"from":{"id":100000000,"first_name":"Nnn","username":"myid"},"chat":{"id":101150186,"first_name":"Nnn","username":"myid","type":"private"},"date":1487570256,"photo":[{"file_id":"AgADBAAD4KcxG9qfWFEqGZHRzv1IReOGnhkABOym5qINB41gwLIBAAEC","file_size":480,"width":90,"height":44},{"file_id":"AgADBAAD4KcxG9qfWFEqGZHRzv1IReOGnhkABCkXQqPZCWHswbIBAAEC","file_size":2694,"width":273,"height":132}]}}]}'; $arrayUpdate= json_decode($response, true); foreach ($arrayUpdate['result'] as $key) { echo "user id is:".$key['message']['from']['id']."<br />"; echo…

VIEW QUESTION
Back To Top
Search