I am trying to use the country detection by IP, an API from http://www.hostip.info/use.html
So if you put in your browser something like:
http://api.hostip.info/country.php?ip=12.24.25.26
then the page will write “US”…
Now my question is how can I use this in a IF ELSE lopp in my php code? I think I have to parse that HTML page, but at the moment I have no clue, some help would be appriciated!
Thanks.
Since that page does not output anything other than the country code, there is no parsing required. A simple check on the returned HTML will do it.