<?php
function is_ip(){  
    $localIp=get_client_ip();
    $ipRanges=C('INIP');
    $localIp = ip2long($localIp);   
    foreach($ipRanges as $val) 
    {  
       $ipmin=sprintf("%u",ip2long($val[0]));
       $ipmax=sprintf("%u",ip2long($val[1]));
       if($localIp >= $ipmin && $localIp <= $ipmax) 
          {   return $val;   }  
  }    
  return false; 
}