扫码关注官方订阅号
项目前期为了方便使用php自带的copy函数抓取其他网站图片,最近出现很多问题,抓图经常失败;保存下来的图片文件是个空文件;
copy
有没有人遇到过,是什么原因导致的,顺便请教下各位,php抓取图片的方案以及需要注意的问题;
php
欢迎选择我的课程,让我们一起见证您的进步~~
配合file_get_contents和file_put_contents两个函数
file_get_contents
file_put_contents
<?php $img_url = 'http://www.baidu.com/img/bd_logo1.png'; $content = file_get_contents($img_url); file_put_contents("1.jpg",$content);
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
配合
file_get_contents和file_put_contents两个函数