You appear to be a bot. Output may be restricted
Description
Determines if this is a private IPThe following ranges are reserved for private networks.
- 192.168.0.0 – 192.168.255.255 (65,536 IP addresses)
- 172.16.0.0 – 172.31.255.255 (1,048,576 IP addresses)
- 10.0.0.0 – 10.255.255.255 (16,777,216 IP addresses)
Usage
$bool = oik_remote::are_you_private_ip( $url );
Parameters
- $url
- ( string ) required – e.g. https://qw/wordpress
Returns
bool true if a private IPTO DO
Determine if we need to check all ranges.Source
File name: oik-libs/libs/class-oik-remote.phpLines:
1 to 6 of 6
static function are_you_private_ip( $url ) { $host = parse_url( $url, PHP_URL_HOST ); $local_ip = gethostbyname( $host ); $local = ( 0 === strpos( $local_ip, "192.168" ) ); return $local; }View on GitHub