src/IpRange/Ipv4Range.php
private function computeLowerAndUpperBounds($range)
    {
        if (strpos($range, '/') !== false) {
            // support CIDR notation
            list($this->lowerInt, $this->upperInt) = $this->parseCidrRange($range);
        } elseif (strpos($range, '-') !== false) {
            // support for IP ranges like '10.0.0.0-10.0.0.255'
            list($this->lowerInt, $this->upperInt) = $this->parseHyphenRange($range);
        } elseif (($pos = strpos($range, '*')) !== false) {
            // support for IP ranges like '10.0.*'
            list($this->lowerInt, $this->upperInt) = $this->parseWildcardRange($range, $pos);
        } else {
            // assume we have a single address
            $this->lowerInt = ip2long($range);
            $this->upperInt = $this->lowerInt;
        }
    }
private function computeLowerAndUpperBounds($range)
    {
        if (strpos($range, '/') !== false) {
            // support CIDR notation
            list($this->lowerInt, $this->upperInt) = $this->parseCidrRange($range);
        } elseif (strpos($range, '-') !== false) {
            // support for IP ranges like '10.0.0.0-10.0.0.255'
            list($this->lowerInt, $this->upperInt) = $this->parseHyphenRange($range);
        } elseif (($pos = strpos($range, '*')) !== false) {
            // support for IP ranges like '10.0.*'
            list($this->lowerInt, $this->upperInt) = $this->parseWildcardRange($range, $pos);
        } else {
            // assume we have a single address
            $this->lowerInt = ip2long($range);
            $this->upperInt = $this->lowerInt;
        }
    }
private function computeLowerAndUpperBounds ( $ range ) { if ( strpos ( $ range , '/' ) !== false ) { // support CIDR notation list ( $ this -> lowerInt , $ this -> upperInt ) = $ this -> parseCidrRange ( $ range ) ; } elseif ( strpos ( $ range , '-' ) !== false ) { // support for IP ranges like '10.0.0.0-10.0.0.255' list ( $ this -> lowerInt , $ this -> upperInt ) = $ this -> parseHyphenRange ( $ range ) ; } elseif ( ( $ pos = strpos ( $ range , '*' ) ) !== false ) { // support for IP ranges like '10.0.*' list ( $ this -> lowerInt , $ this -> upperInt ) = $ this -> parseWildcardRange ( $ range , $ pos ) ; } else { // assume we have a single address $ this -> lowerInt = ip2long ( $ range ) ; $ this -> upperInt = $ this -> lowerInt ; } }
Computes the lower and upper bounds of the IPv4 range by parsing the
range string.
@param string $range The IPv4 range as a string.
Computes the lower and upper bounds of the IPv4 range by parsing the range string .