| PHP preg match IP-adress check |
| Section: Scripting | Rating: Not rated yet! |
 | CodeGod submitted this resource The member's homepage is http://www.codegod.de Visit the profile here |
<?php
function IsIPAdress($value){
if (preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $value)){
return true;
}
return false;
}
if( IsIPAdress("192.168.0.1") )
echo("This is an IPAdress");
else
echo("This is not an IPAdress");
?>