Net_IPv4::validateIP()

Net_IPv4::validateIP() – Validate the syntax of the given IP adress.

Synopsis

require_once 'Net/IPv4.php';

bool validateIP ( string $ip_addr )

Description

Validates the syntax of an IP address in dot-quad format. Returns true if address is valid, false if not.

Note

This function can be called statically.

Converts an IP address to a PHP double. (Previous) Validate the syntax of the given netmask. (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

Note by: kguest
remembering this function is a method of the Net_IPv4 class, the simplest example of using this is:

<?php
require_once("Net/IPv4.php");

$valid_ip Net_IPv4::validateIP($ip_address);
?>