sudhakararaog Posted July 14, 2008 Share Posted July 14, 2008 i am using $ip= $_SERVER['REMOTE_ADDR'] to retrieve the ip address of the client for example if the value returned from $ip is 50.160.190.150 i would like to find out which country the request has come from. i believe by using the third set of numbers (in this case=190) from an ip address we can find out the country name. i can declare a variable with a list of country names and the range of values, what i need help is to extract the 3rd set of numbers from $ip. as ip address keep changing the 3rd set of numbers can be single, double or 3 digit number how can we extract the number that is stored in $ip after the second dot and before the third dot please advice. thanks. Link to comment https://forums.phpfreaks.com/topic/114633-using-string-functions/ Share on other sites More sharing options...
JasonLewis Posted July 14, 2008 Share Posted July 14, 2008 I believe it's more complicated then that. http://www.maxmind.com http://www.maxmind.com/app/ip-locate Link to comment https://forums.phpfreaks.com/topic/114633-using-string-functions/#findComment-589374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.