Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // فونكشن اظهار ايبي دولة عضو
- function ipToCountry($ip){
- $info = file_get_contents("http://who.is/whois-ip/ip-address/$ip");
- list($a, $b) = explode('country: ', $info);
- return substr($b,0,2);
- }
- echo "Your IP: ".$_SERVER['REMOTE_ADDR']."";
- echo 'Country: ' .ipToCountry($_SERVER['REMOTE_ADDR']);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement