I need to check to see if a file exists on a remote server that I have no control over (or rather, no control that lets me do anything). Is the following code sane? I need to make sure the file exists and then create a link to it for the viewer to (optionally) follow. I'm worried about leaving file handles open, etc. This seems to work on the few quick tests I've done, but I've never used fopen/fclose and their friends....
function URLExists($url){
if(@$u=fopen($url,"r")){
@fclose($u);
return true;
}else{
return false;
}
}