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


require_once 'Net/IPv4.php';

bool validateIP ( string $ip_addr )


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


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:


$valid_ip Net_IPv4::validateIP($ip_address);