In there an easy way to do this in PHP. I want to make sure that only web requests from certain countries are able to access my website.
Any ideas?
if you use the answer of Ben Dowling and the code doesn't work, try this:
if (!in_array(substr($country, 0, 2), $allowed_countries)) {
instead of:
if(!in_array($country, $allowed_countries)) {