Last active
August 29, 2015 14:16
-
-
Save probil/43a0d8db2f21715741fa to your computer and use it in GitHub Desktop.
Is remote url exists function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_url_exist($url){ | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_NOBODY, true); | |
curl_exec($ch); | |
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE); | |
if($code == 200){ | |
$status = true; | |
}else{ | |
$status = false; | |
} | |
curl_close($ch); | |
return $status; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment