How to Validate IPv4 Address in PHP

2 Responses

  1. gafitescudaniel says:

    or

    $ip_a = ‘127.0.0.1’;
    $ip_b = ‘42.42’;

    if (filter_var($ip_a, FILTER_VALIDATE_IP)) {
    echo “This (ip_a) IP address is considered valid.”;
    }
    if (filter_var($ip_b, FILTER_VALIDATE_IP)) {
    echo “This (ip_b) IP address is considered valid.”;
    }

  2. Thanks for finally writing about >Validate IPv4 Address in PHP – W3lessons Programming
    Blog <Loved it!

Leave a Reply

Your email address will not be published. Required fields are marked *