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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -