public function checkIpIsPrivate($ipGiven)
    {
        if (filter_var($ipGiven, FILTER_VALIDATE_IP)) {
            if (!filter_var($ipGiven, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE)) {
                return 'private';
            }
            return 'public';
        }
        return 'invalid IP';
    }
public function checkIpIsPrivate($ipGiven)
    {
        if (filter_var($ipGiven, FILTER_VALIDATE_IP)) {
            if (!filter_var($ipGiven, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE)) {
                return 'private';
            }
            return 'public';
        }
        return 'invalid IP';
    }
public function checkIpIsPrivate ( $ ipGiven ) { if ( filter_var ( $ ipGiven , FILTER_VALIDATE_IP ) ) { if ( ! filter_var ( $ ipGiven , FILTER_VALIDATE_IP , FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE ) ) { return 'private' ; } return 'public' ; } return 'invalid IP' ; }
Checks if given IP is a private or public one

@param ipv4 $ipGiven
@return string
Checks if given IP is a private or public one