if this is your issue, then you can use curl. Here is a similar way to do what file_get_contents() does for urls with curl: function file_get_contents_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); $data = curl_exec($ch); curl_close($ch); return $data; } Then you can modify the first function like this: function drop_pending_updates($webhook_url, $token) { return file_get_contents_curl("https://api.telegram.org/bot".$token."/setwebhook?url=".$webhook_url."?drop_pending_updates=true"); }
Обсуждают сегодня