Hello PHP Developers,
One more innovation from Black iD Solutions. We are developing an IP2Country database. I know this is a very common application. But our target users are those PHP developers who find it difficult to get the IP information for their users. For eg. If you wanted to know the country from the ipaddress, you would have to do either of the 2.
1. Buy a costly subscription from some of the sites
2. Download the entire IP2Country Database from
But now we have come up with a way you can easily get an access of the country information from the IP Address. The method is simple.
<?php
$f = fopen( "http://scripts.blackidsolutions.com/ip2country/?ip=202.186.13.4&get=country","r");
$country = fread($f,40); // Additional reading capability to ensure the country's name is not cut
echo $country; // Displays MALASIA
?>
By using the simple code you can get the country of visitor from the IP address. I will be publishing more information on this too. To get the 2 letter country code simply replace “&get=country” with “&get=ctry“. Also to get the 3 letter country code you can replace it by “cntry”.
Hope this helps.
Thanks
Jyot
