PHP IP Restriction from array
<p><strong>(1.)</strong> I want allow visitors to access a page just from a some IP Address Range <em>(paragraph 2)</em>. easily as adding more regex of IP Address to IP Address List.    </p>

<p><strong>My regular expression array is :</strong>  </p>

<pre><code>$IP_LIST_ACCESS = array(  
"/^188\.133\.11\.([1-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4]))$/"  
,"/^188\.133\.14\.([1-9]|[1-9][0-9]|1([0-1][0-9]|2[0-8]))$/"  
,"/^127\.0\.0\.1$/"                                                         
);
</code></pre>

<p><strong>(2.)</strong> IP Range of above array is <code>188.133.11.1-188.133.11.254</code> and <code>188.136.14.1-188.136.14.128</code> and <code>127.0.0.1</code>  </p>

<p>and bellow is <strong>My codes to detect wrong ip address and die:</strong>  </p>

<pre><code>$USER_IP_ADDR = $_SERVER['REMOTE_ADDR'];
foreach ($IP_LIST_ACCESS as $IP_ACC_ARRAY)
{
  if (!preg_match($IP_ACC_ARRAY, $USER_IP_ADDR))
  {
    echo '#INVALID IP'; #DEBUG
    die;
  }
}
</code></pre>

<p><strong>(3.)</strong> with my above codes , always give <code>INVALID IP</code> Error (always detect as wrong IP address) .<br>
<strong>Where is the problem ?</strong></p>

<p><strong>EDIT</strong><br>
<strong>(4.)</strong> I just want to do this , not exact with preg_match if have a better way .</p>
