Advertisement
Guest User

Untitled

a guest
Jul 26th, 2018
995
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1.  <?php
  2. header('Content-Type: text/html; charset=UTF-8');
  3.  
  4. $clantag = "<#CLANTAG>"; // #Clantag (capital letters)
  5.  
  6. $token = "<TOKEN>";
  7. $url = "https://api.clashroyale.com/v1/clans/" . urlencode($clantag);
  8.  
  9. $ch = curl_init($url);
  10.  
  11. $headr = array();
  12. $headr[] = "Accept: application/json";
  13. $headr[] = "Authorization: Bearer ".$token;
  14.  
  15. curl_setopt($ch, CURLOPT_HTTPHEADER, $headr);
  16. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  17. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  18. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  19.  
  20. $res = curl_exec($ch);
  21. $data = json_decode($res, true);
  22. curl_close($ch);
  23.  
  24. echo "<pre>";
  25. print_r($data);
  26. echo "</pre>";
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement