FILTER_VALIDATE_IP

Check whether the given IP is valid or not
Example
======

<?php
if(filter_var(“345.454.3.3”, FILTER_VALIDATE_IP)) {
echo “Valid IP”;
}else{
echo “invalid IP”;
}
?>

Output
=====

invalid IP