Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to check validate url in php ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 168
    Comment on it

    Hi Reader's,
    Welcome to FindNerd, today we are going to discuss how to check validate url in php ?

    If want to check validate url in php then you can use FILTER_VALIDATE_URL.This is filter validates a URL.
    you can see below example

     <?php
        // Variable to check
        $url = "http://www.example.com";
    
        // Validate url
        if (!filter_var($url, FILTER_VALIDATE_URL) === false) {
             echo("$url is a valid URL");
        } else {
             echo("$url is not a valid URL");
        }
    ?>
    

    The output of the code above will be:

    Success ! Url is a valid URL
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: