(Last Updated On: May 18, 2011)

You can use the PHP code below to check if an IP address is valid or not.

[code lang=”php”]
$ip = “”; //enter a valid or invalid ip address here
if(filter_var($ip, FILTER_VALIDATE_IP)) {
// The IP Address is valid
} else {
// The IP Address is not valid

Wasn’t that easy!?!

Leave a Reply

Your email address will not be published.

%d bloggers like this: