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, 2086🔥, 0💬
Popular Posts:
What is this Website about? This Website provides a collection of Frequently Asked Questions (FAQ) a...
"Muss i denn" is a German folk song in the Swabian German dialect. The present form dates back to 18...
What are control codes used in Microsoft Word that can be used in the Find and Replace command? Here...
How to Uninstall Skype Meetings App on Windows? I don't need it anymore. You can following this tuto...
How to create two columns in Microsoft Word documents? If you want to make a part of a Word document...