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, ∼2491🔥, 0💬
Popular Posts:
How to view the document.xml file with a Web browser? Since the document.xml file contains text cont...
How to log in to Microsoft Teams with a Web browser? I know that my company is using Microsoft Teams...
Where to find answers to frequently asked questions on Adobe FrameMaker? I want to know how to know ...
Why I am getting the "FTP over TLS is not enabled, users cannot securely log in" waring on my FileZi...
Where to find answers to frequently asked questions about Microsoft Office 365? Here is a collection...