RsD0p9BK
7/24/2013 - 7:30 AM

exist_fo.php

function file_exists_remote($url) {
 $curl = curl_init($url);
 curl_setopt($curl, CURLOPT_NOBODY, true);
 //Check connection only
 $result = curl_exec($curl);
 //Actual request
 $ret = false;
 if ($result !== false) {
  $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  //Check HTTP status code
  if ($statusCode == 200) {
   $ret = true;   
  }
 }
 curl_close($curl);
 return $ret;
}
function exist($input){
	$Headers = get_headers($input);
	if( strpos($Headers[0], '200') )
		return true;
}
function exist($input){
	if (@fopen($input,"r")){
		return true;
	}
	return false;
}