這篇文章主要介紹了PHP判斷網絡文件是否存在的方法,實例分析了php讀取網絡文件的技巧,具有一定參考借鑒價值,需要的朋友可以參考下
本文實例講述了PHP判斷網絡文件是否存在的方法。分享給大家供大家參考。具體實現方法如下:
- $file = "http://www.49028c.com/demo/file_exists.zip";
- $fileExists = @file_get_contents($file,null,null,-1,1) ? true : false;
- if($fileExists){
- echo "File Exists!";
- }else{
- echo "Sorry, we couldn't find the file.";
- }
希望本文所述對大家的php程序設計有所幫助。
新聞熱點
疑難解答