PEAR Manual
This manual is provided as a courtesy. It is not an official source. Please check pear.php.net for updated information.
require_once 'Net/CheckIP.php';
boolean Net_CheckIP::check_ip (string $ip)
boolean Net_CheckIP::check_ip
This function can validate if a given string has a valid IPv4 syntax.
string $ip - the IP address to check
boolean - TRUE, if syntax is valid
This function can be called statically.
Example 47-1. Using check_ip()
require_once "Net_CheckIP/CheckIP.php"; if (Net_CheckIP::check_ip("your_ip_goes_here")) { // Syntax of the IP is ok }