Advertisement
shaashwato1308

API Run

Oct 17th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. function scs_api_run($url)  {  
  2.             $ch = curl_init();  
  3.             $timeout = 5;  
  4.             curl_setopt($ch,CURLOPT_URL, $url);  
  5.             curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);  
  6.             curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);  
  7.             $data = curl_exec($ch);  
  8.             curl_close($ch);
  9.             $data = json_decode($data, true);
  10.             return $data;  
  11.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement