Ip Validation
This function allows you to validate an IP address and check if it is valid and supported by our conversion services.
import { IpValidation } from '@ip2geo/sdk'
const ipAddress = '8.8.8.8'
const { ip4, ip6 } = await IpValidation(ipAddress)result = Ip2Geo.ip_validation('8.8.8.8')
# { ip4: true, ip6: false }import ip2geo
result = ip2geo.ip_validation('8.8.8.8')
# { 'ip4': True, 'ip6': False }<?php
use Ip2Geo\Ip2Geo;
$result = Ip2Geo::ipValidation('8.8.8.8');
// ['ip4' => true, 'ip6' => false]Parameters
ipAddressstringrequiredThe IPv4 or IPv6 address to validate.
Response
IpValidationResultobjectAn object containing validation results:
ip4:boolean- Whether the IP address is a valid IPv4 address.ip6:boolean- Whether the IP address is a valid IPv6 address.
Parameters
ip_addressStringrequiredThe IPv4 or IPv6 address to validate.
Response
HashobjectA hash containing validation results:
:ip4:Boolean- Whether the IP address is a valid IPv4 address.:ip6:Boolean- Whether the IP address is a valid IPv6 address.