PHP如何检测网络文件是否存在?

更新于
2026-09-26 07:06:26
0阅读来源:SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计42个文字,预计阅读时间需要1分钟。

PHP如何检测网络文件是否存在?

php

[PHP]代码

$file = "www.xxx.nxxxet/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如何检测网络文件是否存在?