Redirecting IP if it's between a certain IP Range
<p>I'm using a redirect if the user's ip is between a certain IP range. However, I'm using multiple ip ranges, so I'm wondering the best way to do this. I'm current using this to redirect, </p>

<p>

<pre><code>);

// read user ip adress:
$ip = isset($_SERVER['REMOTE_ADDR']) ? trim($_SERVER['REMOTE_ADDR']) : '';

if (($i = array_search($ip, $deny_ips)) !== FALSE){


    // user is blocked
    header("location: http://urlhere.com/include");

}
</code></pre>

<p>?></p>

<p>But if the IP ranges are say from 72.122.166.0-72.122.159.266 and 68.61.156.0-68.61.181.255 and 78.121.74.0-78.121.77.255 then how would I do that? Thanks!</p>
