最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
用PHP判断远程图片(文件)是否存在
时间:2022-06-24 21:28:29 编辑:袖梨 来源:一聚教程网
代码如下 | 复制代码 |
/* *用PHP判断远程图片(文件)是否存在 *http://www.111com.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") |
相关文章
- Bitget交易所app v2.25.2 官网安卓最新版 04-18
- 崩坏星穹铁道战意狂潮全关卡攻略 04-18
- 《逆水寒手游》玄机锦囊获得攻略 04-18
- 光遇4.18大蜡烛在哪里 04-18
- 光遇4.18免费魔法有什么 04-18
- 光遇4.18复刻先祖在哪里 04-18