<?php $url = 'http://xxxxx/upload/2564/images/2021071517431531.jpg'; $img = '1.jpg'; // Function to write image into file file_put_contents($img, file_get_contents($url)); echo "File downloaded!" ?>
php使用file_get_contents和file_put_contents 下载网络图片到本地服务器。