Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Alternative Site https://api.ipdata.co/
- $ip_address = $_SERVER["REMOTE_ADDR"];
- $url = "http://ip-api.com/json/$ip_address";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_URL, $url);
- $response = curl_exec($ch);
- $arr_result = json_decode($response);
- echo($response);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement