Learn, Practice, and Excel with our Coding Tutorials!

URL Exist or Not Exist Check PHP

June 9, 2022 1 Min read PHP

We can easily check a given URL or Link is active or not. By using below PHP function we can easily get whether the given URL is active or not active.



$array = get_headers($url);
$string = $array[0];
    echo 'URL Exist';
    echo 'URL does not exist';
Tags: URL URL Exist
Related Post:
Add HTTP Protocol if not Exist with URL −  The below function is used to add HTTP protocol to the URL if not available. You can add “http://” or “https://” by using the function.