A working example is here which prints out the country and even city of the IP address that you’re located now.

Update: The HostIP.info also allows additional parameter position=true that will return more complete information including the latitude and longitude of where you’re located. A more thorough example is included below which includes the “Country”, “City”, “Latitude”,”Longitude”, “IP”, returned in an associative array, which you can then segregate the data easily such as to store them in your database. And the Latitude and longitude will be useful so you can display them on the Google Map or plot all the red dots on a Google Map to reveal your visitors from different countries. Take a look at the 2nd example below: