Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: text/html; charset=UTF-8');
- $clantag = "<#CLANTAG>"; // #Clantag (capital letters)
- $token = "<TOKEN>";
- $url = "https://api.clashroyale.com/v1/clans/" . urlencode($clantag);
- $ch = curl_init($url);
- $headr = array();
- $headr[] = "Accept: application/json";
- $headr[] = "Authorization: Bearer ".$token;
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headr);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $res = curl_exec($ch);
- $data = json_decode($res, true);
- curl_close($ch);
- echo "<pre>";
- print_r($data);
- echo "</pre>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement