Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (490)
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, ∼2608🔥, 0💬
Popular Posts:
How to add a new layout to the slide master in PowerPoint? In my PowerPoint presentation, I need to ...
What is the port number used for the control connection in FileZilla Server? How to change control c...
What port numbers are used for data connections in passive mode in FileZilla Server? Can I limit the...
Where to find answers to frequently asked questions on Microsoft Skype? I want to know how to know h...
What is outlook.office365.com? Our IT tells us to migrate to outlook.office365.com. outlook.office36...