Location: PHPKode > scripts > K-Pregs > k-pregs/examples/ip.php
<?php

require("../kpregs.php");

/*
Check for valid ip
*/

if (kpreg_is_valid_ip("127.0.0.1")) // valid
 echo("Valid!");
else
 echo("Invalid!");

if (kpreg_is_valid_ip("255.255.255.500")) // invalid, 500 cannot be ip number!
 echo("Valid!");
else
 echo("Invalid!");

?>
Return current item: K-Pregs