[ad_1]
<?php /*Get user ip address*/ $ip_address=$_SERVER['REMOTE_ADDR']; /*Get user ip address details with geoplugin.net*/ $geopluginURL='http://www.geoplugin.net/php.gp?ip='.$ip_address; $addrDetailsArr = unserialize(file_get_contents($geopluginURL)); /*Get City name by return array*/ $city = $addrDetailsArr['geoplugin_city']; /*Get Country name by return array*/ $country = $addrDetailsArr['geoplugin_countryName']; /*Comment out these line to see all the posible details*/ /*echo ''; print_r($addrDetailsArr); die();*/ if(!$city){ $city='Not Define'; }if(!$country){ $country='Not Define'; } echo 'IP Address:- '.$ip_address.'
'; echo 'City:- '.$city.'
'; echo 'Country:- '.$country.'
'; ?>Télécharger le code source (obtenir le pays de la ville par adresse IP en PHP)
Taille: 27 Ko
Version: V 1
[ad_2]
Telecharger ici

