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, 1986🔥, 0💬
Popular Posts:
What is "OneNote Notes about Word Documents" add-in in Microsoft Word? Should I disable it? "OneNote...
How to download FrameMaker 2017 Release for my Windows computer? I want to try it. You can follow th...
How to edit Mozilla Firefox configuration file? Mozilla Firefox has a configuration file that contro...
Where are Microsoft Teams files located on my macOS computer? If you have Microsoft Teams desktop so...
How to unzip an XPS (XML Paper Specification, .xps) file? According to Microsoft documentation, an ....