Overview
  • Namespace
  • Class
  • Tree

Namespaces

  • Modulework
    • Modules
      • Http
        • Exceptions
        • Utilities
  • PHP

Classes

  • ArrayCase
  • FileCase
  • HeaderCase
  • HeaderWrapper
  • IpValidator
  • ServerCase

Interfaces

  • ArrayCaseInterface
  • HeaderWrapperInterface
  • IpValidatorInterface

Class IpValidator

IP Validator Validates IPv4 and IPv6 address

Modulework\Modules\Http\Utilities\IpValidator implements Modulework\Modules\Http\Utilities\IpValidatorInterface
Namespace: Modulework\Modules\Http\Utilities
Located at Modulework/Modules/Http/Utilities/IpValidator.php

Methods summary

public static boolean
# all( string $ip )

Checks if it is a valid IPv4 or IPv6 address Private, reserved and broadcast addresses will return false.

Checks if it is a valid IPv4 or IPv6 address Private, reserved and broadcast addresses will return false.

Parameters

$ip
string
$ip The IP to check

Returns

boolean
Whether it is a valid IP address

Implementation of

Modulework\Modules\Http\Utilities\IpValidatorInterface::all()
public static boolean
# ipv4( string $ip )

Checks if the given string is valid IPv4 address

Checks if the given string is valid IPv4 address

Parameters

$ip
string
$ip The IP

Returns

boolean
Whether it is a valid IPv4 address

Implementation of

Modulework\Modules\Http\Utilities\IpValidatorInterface::ipv4()
public static boolean
# ipv6( string $ip )

Checks if the given string is valid IPv6 address

Checks if the given string is valid IPv6 address

Parameters

$ip
string
$ip The IP

Returns

boolean
Whether it is a valid IPv6 address

Implementation of

Modulework\Modules\Http\Utilities\IpValidatorInterface::ipv6()
public static boolean
# isPrivate( string $ip )

Checks if the given string is a private IP address (in private range (RFC 1918))

Checks if the given string is a private IP address (in private range (RFC 1918))

Parameters

$ip
string
$ip The IP

Returns

boolean
TRUE if the IP is a private address

Implementation of

Modulework\Modules\Http\Utilities\IpValidatorInterface::isPrivate()
public static boolean
# isReserved( string $ip )

Checks if the given string is a reserved IP address (in reserved range)

Checks if the given string is a reserved IP address (in reserved range)

Parameters

$ip
string
$ip The IP

Returns

boolean
TRUE if the IP is a reserved IP address

Implementation of

Modulework\Modules\Http\Utilities\IpValidatorInterface::isReserved()
public static boolean
# isBroadcast( string $ip )

Checks if the given string is a broadcast IP address e.g. 0.0.0.0

Checks if the given string is a broadcast IP address e.g. 0.0.0.0

Parameters

$ip
string
$ip The IP

Returns

boolean
TRUE if the IP is a broadcast address | FALSE if not a valid IP

Implementation of

Modulework\Modules\Http\Utilities\IpValidatorInterface::isBroadcast()

Magic methods summary

API documentation generated by ApiGen 2.8.0