Advertisement
Guest User

Https()

a guest
Feb 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. function Https($method,$datas){
  2. $url = "https://api.telegram.org/bot".API_KEY."/".$method;
  3. $ch = curl_init();
  4. curl_setopt($ch,CURLOPT_URL,$url);
  5. curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  6. curl_setopt($ch,CURLOPT_POSTFIELDS,$datas);
  7. $res = curl_exec($ch);
  8.  
  9.  
  10.  
  11. if(curl_error($ch)){ var_dump(curl_error($ch)); }
  12. else{ return json_decode($res); }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement