A simple method of validating an IP address using PHP and regular expressions
<? $string = “255.255.255.255”; if (preg_match( ‘/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/’, $string)) { echo “IP address is good.”; } ?>
http://www.roscripts.com/PHP_regular_expressions_examples-136
html http://snipplr.com/view/7047/php-regex-ip-address-validation/