php - How to check if a file exists from a url -
i need check if particular file exists on remote server. using is_file()
, file_exists()
doesn't work. ideas how , easily?
you have use curl
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; }
Comments
Post a Comment