[ class tree: Net_CheckIP ] [ index: Net_CheckIP ] [ all elements ]

Class: Net_CheckIP

Source Location: /Net_CheckIP-1.2.2/Net/CheckIP.php

Class Overview

Class to validate the syntax of IPv4 adresses



  • 1.1


Inherited Variables

Inherited Methods

Class Details

[line 45]
Class to validate the syntax of IPv4 adresses

Usage: <?php require_once "Net/CheckIP.php";

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

[ Top ]

Method Detail

check_ip   [line 60]

bool check_ip( string $ip)

Validate the syntax of the given IP adress

This function splits the IP address in 4 pieces (separated by ".") and checks for each piece if it's an integer value between 0 and 255. If all 4 parameters pass this test, the function returns true.

  • Return: true if syntax is valid, otherwise false


string   $ip   —  IP adress

[ Top ]

Documentation generated on Wed, 09 Dec 2015 22:51:46 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.