PHP通过api上传图片

参考:接口实现图片上传

提交端:

    $url="localhost:805/rdyc/123.jpg";
    $img=file_get_contents($url);

    $img_api="http://localhost:805/hello.php";
    $img_api_url=$img_api.'?'.http_build_query(array('img'=>$img));

    file_get_contents($img_api_url);

接收端:

$img=$_GET['img'];
$file="./a.jpg";
file_put_contents($file,$img);
原文地址:https://www.cnblogs.com/zjfblog/p/8548274.html