Net_CheckIP2::isValid()

Net_CheckIP2::isValid() – Validation of IPv4 addresses

Synopsis

require_once 'Net/CheckIP2.php';

boolean Net_CheckIP2::isValid ( string $ip )

Description

This function can validate if a given string has a valid IPv4 syntax.

Parameter

  • string $ip - the IP address to check

Return value

boolean - TRUE, if syntax is valid

Note

This function can be called statically.

Example

Using isValid()

<?php
require_once 'Net_CheckIP2/CheckIP.php';

if (
Net_CheckIP::isValid("your_ip_goes_here")) {
    
// Syntax of the IP is ok
}
?>
Net_CheckIP2 (Previous) From Net_CheckIP to Net_CheckIP2 (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:

There are no user contributed notes for this page.