php怎么判断远程文件是否存在

WBOY
Release: 2016-06-13 11:50:21
Original
875 people have browsed it

php怎样判断远程文件是否存在
php 有什么方法  来判断远程文件是否存在
------解决方案--------------------

$url = 'http://www.example.com';<br /><br />print_r(get_headers($url));<br /><br />print_r(get_headers($url, 1));
Copy after login


获取远程文件HEAD信息。如果等于HTTP/1.1 200 OK 则证明文件存在

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template