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, 1930🔥, 0💬
Popular Posts:
Where to find answers to frequently asked questions about Adobe Flash Player? I want to understand m...
How to view dynamic field codes in Microsoft Word? Each dynamic value is Microsoft Word is driven by...
How register my Fitbit device through Fitbit Connect? I have an account with Fitbit server, installe...
Where to find answers to frequently asked questions on Mozilla Firefox? I want to know how to know h...
How to connect FileZilla to an Anonymous FTP Server? If you know the server host name, you can conne...