previousNet_CheckIP (Previous) (Next) Net_CheckIP2next

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Net_CheckIP::check_ip()

Net_CheckIP::check_ip() – Validation of IPv4 addresses

Synopsis

require_once 'Net/CheckIP.php';

boolean Net_CheckIP::check_ip ( 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 check_ip()

<?php
require_once "Net_CheckIP/CheckIP.php";

if (
Net_CheckIP::check_ip("your_ip_goes_here")) {
    
// Syntax of the IP is ok
}
?>
previousNet_CheckIP (Previous) (Next) Net_CheckIP2next

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.