src/Chippyash/Validation/Util/IpUtil.php
protected static function cidrMatch32bit($ipAddr, $cidr)
    {
        list ($subNet, $bits) = explode('/', $cidr);
        $ipLong = \ip2long($ipAddr);
        $subnetLong = \ip2long($subNet);
        $mask = -1 << (32 - $bits);
        $subnetLong &= $mask; // nb: in case the supplied subnet wasn't correctly aligned
        return ($ipLong & $mask) == $subnetLong;
    }
protected static function cidrMatch32bit($ipAddr, $cidr)
    {
        list ($subNet, $bits) = explode('/', $cidr);
        $ipLong = \ip2long($ipAddr);
        $subnetLong = \ip2long($subNet);
        $mask = -1 << (32 - $bits);
        $subnetLong &= $mask; // nb: in case the supplied subnet wasn't correctly aligned
        return ($ipLong & $mask) == $subnetLong;
    }
protected static function cidrMatch32bit ( $ ipAddr , $ cidr ) { list ( $ subNet , $ bits ) = explode ( '/' , $ cidr ) ; $ ipLong = \ ip2long ( $ ipAddr ) ; $ subnetLong = \ ip2long ( $ subNet ) ; $ mask = - 1 << ( 32 - $ bits ) ; $ subnetLong &= $ mask ; // nb: in case the supplied subnet wasn't correctly aligned return ( $ ipLong & $ mask ) == $ subnetLong ; }
32 bit processor CIDR match

@codeCoverageIgnore

@link http://stackoverflow.com/questions/594112/matching-an-ip-to-a-cidr-mask-in-php5

@param  string $ipAddr
@param  string $cidr
@return boolean
32 bit processor CIDR match