Skip to content

Instantly share code, notes, and snippets.

@probil
Last active August 29, 2015 14:16
Show Gist options
  • Save probil/43a0d8db2f21715741fa to your computer and use it in GitHub Desktop.
Save probil/43a0d8db2f21715741fa to your computer and use it in GitHub Desktop.
Is remote url exists function
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