最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
用PHP判断远程图片(文件)是否存在
时间:2022-06-24 21:28:29 编辑:袖梨 来源:一聚教程网
| 代码如下 | 复制代码 |
|
/* *用PHP判断远程图片(文件)是否存在 *https://www.111cn.net */ function check_remote_file_exists($url) { curl_setopt($curl, CURLOPT_NOBODY, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION,1); $result = curl_exec($curl); if ($result !== false) { $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); $found = true; |
|
还有一种简单的方法,但效率是低下的。
| 代码如下 | 复制代码 |
| strstr(current(get_headers($url)), "200") | |
相关文章
- 无畏冒险手游新手攻略无畏冒险手游入门指南及快速上手技巧 07-23
- 守护精灵奇迹礼包码领取攻略 2026最新可用礼包码分享 07-23
- 逃跑吧少年绯音技能解析 07-23
- hbase thrift怎样扩展 07-23
- MAC地址生成器网页版-MAC地址生成器网页版工具 07-23
- Corrector App-Corrector App为一款在线拼写检查工具 07-23