class vB_Ip

Traits

Constants

IPV4_REGEX

Methods

__sleep()

No description

__wakeup()

No description

static bool
isValidIPv4(string $ipAddress)

Validates an IPv4 address

static mixed
validateIPv6(string $ipAddress)

Validates an IPv6 string representation and returns the ip fields for storage. If representation is invalid it returns false.

static mixed
getIpFields(string $ipAddress)

Gets ip fields for storage from a string representation of IP. If the IP string is invalid it returns false.

static boolean
areIpsEqual(string $ip1, string $ip2)

Determines if the IPS are the same. Note that this should work ccross different formats

static boolean
ipInArray($ip, $iparray)

Determines if the ip is one of the IPs are the same based on the rules for areIpsEqual

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 24
static bool isValidIPv4(string $ipAddress)

Validates an IPv4 address

Parameters

string $ipAddress

Return Value

bool

at line 47
static mixed validateIPv6(string $ipAddress)

Validates an IPv6 string representation and returns the ip fields for storage. If representation is invalid it returns false.

Parameters

string $ipAddress

Return Value

mixed

at line 159
static mixed getIpFields(string $ipAddress)

Gets ip fields for storage from a string representation of IP. If the IP string is invalid it returns false.

Parameters

string $ipAddress

Return Value

mixed

at line 191
static boolean areIpsEqual(string $ip1, string $ip2)

Determines if the IPS are the same. Note that this should work ccross different formats

Note that if either ip address string is invalid the function will always return false.

Assumes the ip values are both strings

Parameters

string $ip1
string $ip2

Return Value

boolean

at line 226
static boolean ipInArray($ip, $iparray)

Determines if the ip is one of the IPs are the same based on the rules for areIpsEqual

Assumes the ip values are all strings

Parameters

$ip
$iparray

Return Value

boolean