Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (430)
Testing (4)
Tools (488)
Twitter (5)
Wearable (26)
Web Design (44)
Collections:
Other Resources:
How to get Country By IP Address in PHP
Useful PHP Code Snippets for Developers - How to get Country By IP Address in PHP
✍: Guest
'', 'city'=>'');
if(filter_var($client, FILTER_VALIDATE_IP)){
$ip = $client;
}elseif(filter_var($forward, FILTER_VALIDATE_IP)){
$ip = $forward;
}else{
$ip = $remote;
}
$ip_data = @json_decode
(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip));
if($ip_data && $ip_data->geoplugin_countryName != null){
$result['country'] = $ip_data->geoplugin_countryCode;
$result['city'] = $ip_data->geoplugin_city;
}
return $result;
}
?>
2015-06-19, 2028🔥, 0💬
Popular Posts:
How to install Mozilla Firefox 2.0 add-on: FireFTP? FireFTP is a Mozilla Firefox 2 add-on that provi...
What is the difference between a Web page and a filtered Web page? Word supports 2 Web page formats:...
How to save word documents into Unicode UTF-8 text files? When I convert Word documents into text fi...
Collections: Best World Music BitTorrent FAQ Chrome FAQ Facebook FAQ Firefox FAQ Fitbit FAQ Flash Pl...
How to create a new WeChat account without phone number? I want to use WeChat, but I don't have a ce...