Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. $curl = curl_init();
  2.  
  3. curl_setopt_array($curl, array(
  4.   CURLOPT_URL => "https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=Arsenal",
  5.   CURLOPT_RETURNTRANSFER => true,
  6.   CURLOPT_ENCODING => "",
  7.   CURLOPT_MAXREDIRS => 10,
  8.   CURLOPT_TIMEOUT => 30,
  9.   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  10.   CURLOPT_CUSTOMREQUEST => "GET",
  11.   CURLOPT_HTTPHEADER => array(
  12.     "Cache-Control: no-cache",
  13.   ),
  14. ));
  15.  
  16. $response = curl_exec($curl);
  17. $err = curl_error($curl);
  18.  
  19. curl_close($curl);
  20.  
  21. if ($err) {
  22.   echo "cURL Error #:" . $err;
  23. } else {
  24.   echo $response;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement