Net_CheckIP
[ 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


Author(s):

Version:

  • 1.1

Methods


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

Parameters:

string   $ip   —  IP adress

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:40:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.