1
我正在爲使用hook.io編寫一個自己的telegramm bot來搞定php腳本。我的問題是說的file_get_contents(「PHP://輸入」)似乎總是空的,因爲如果我嘗試做相關的更新任何機器人不發生反應:PHP://輸入爲空
$updates = json_decode(file_get_contents('php://input') ,true);
if($updates['ok']){
//loop over all messages
foreach($updates['result'] as $key => $value){
if($value['message']['text']==="/test"){
$chat_id = $value['message']['chat']['id'];
$result = file_get_contents($apiURL . $apiToken . '/sendMessage?chat_id=' . $chat_id . '&text=test');
}
}
}
誰能告訴這個怎麼了?
你試圖做貼在你的後臺?如果它不是一個電報的查詢PHP://無論如何輸入空? –