如何從此回應中提取 id。我試過這樣但回傳空白頁。以下是我得到的回應。
<?php
$res = json_decode($sentMessage ,true);
echo $rc = $res[0]['updates']['id'];
?>
回復 :
{
"_": "updates",
"updates": [{
"_": "updateMessageID",
"id": 291,
"random_id": 8304404519820905816
}, {
"_": "updateReadChannelInbox",
"flags": 0,
"channel_id": 1763732152,
"max_id": 291,
"still_unread_count": 0,
"pts": 717
},
uj5u.com熱心網友回復:
$tes 未定義。
<?php
$res = json_decode($sentMessage ,true);
echo $rc = $res['updates'][0]['id'];
?>
在這里你需要去更新物件,然后取第一個(0)并尋找它的id。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/470166.html
