public static function contains($cidr, $ip)
    {
        $cidr = Range::parse($cidr);

        $ip = new IP($ip);

        if ($cidr->getFirstIP()->getVersion() !== $ip->getVersion()) {
            return false;
        }

        return $cidr->contains($ip);
    }
public static function contains($cidr, $ip)
    {
        $cidr = Range::parse($cidr);

        $ip = new IP($ip);

        if ($cidr->getFirstIP()->getVersion() !== $ip->getVersion()) {
            return false;
        }

        return $cidr->contains($ip);
    }
public static function contains ( $ cidr , $ ip ) { $ cidr = Range :: parse ( $ cidr ) ; $ ip = new IP ( $ ip ) ; if ( $ cidr -> getFirstIP ( ) -> getVersion ( ) !== $ ip -> getVersion ( ) ) { return false ; } return $ cidr -> contains ( $ ip ) ; }
Check if ip is within range.

@param string $cidr
@param string $ip

@return bool
Check if ip is within range .