Posted By

dropthenerd on 01/19/11


Tagged

get remote file check exists contents


Versions (?)

How to see if a remote file exists


 / Published in: PHP
 

URL: http://www.dropthenerd.com/how-to-see-if-a-remote-file-exists-php/

  1. $file = "http://www.dropthenerd.com/demo/file_exists.php";
  2. $fileExists = @file_get_contents($file,null,null,-1,1) ? true : false ;
  3.  
  4. if($fileExists){
  5. echo "File Exists!";
  6. }else{
  7. echo "Sorry, we couldn't find the file.";
  8. }

Report this snippet  

You need to login to post a comment.