I've been searching Google to see how I could detect if someone living outside of the US. I would like to not display certain html if the website viewer lives outside the US. Specifically the contiguous US if that is possible.

I found something like this that might work but there might be an easier way:

PHP Code:
 * ip__allocation.php
    if (isset(
$IPAllocation = array(
            foreach (
$IPAllocation as $addressRange) {
                if (