PHP使用file_get_contents和file_put_contents下载远程图片到本地服务器

<?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 下载网络图片到本地服务器。

You May Also Like

About the Author: 萌新

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注