Validates whether an IPv4 or IPv6 address falls within a reserved range (e.g., private, multicast, or loopback).
reservedIP(string $ip): bool
ip (string) : IPv4 or IPv6 address to validate.
(bool) : Returns true on success and false on failure.
true
false
$cphp->reservedIP('192.168.1.1') = true $cphp->reservedIP('1.1.1.1') = false $cphp->reservedIP('fd00::a:b:c:d') = true $cphp->reservedIP('2001:db8:85a3::8a2e:370:7334') = false
getIP | validIP
Home | CoreyPHP | IP Operations
There was an error while loading. Please reload this page.