Hello all,
Let me first say thank you to Jason Wong and Adam Voigt for their help on
my problem with Multidimensional Arrays!!!
Now I am continuing on with the same script and I need to check for valid
IP address form.
Currently I have:
$ip="255.255.255.0";
if (preg_match ("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $ip)) {
print "Good Ip";
} else {
print "Bad Ip";
}
This does work kinda. It checks to see if the 4 sets of numbers are well
there and numbers.
The problem I am having is that it does not check to see if the IP is in a
proper range ie less than 255.255.255.255
So you could enter 256.256.256.999 and it will say that it is a good IP.
Any clue how I would change it to check for that????
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php