1.发送get请求
file_get_contents('请求地址');
 

2.发送post请求
$info=['eat'=>'2kg','run'=>'10km'] ; $url='http://localhost'; $context =
stream_context_create(array( 'http' => array(   'method' => 'POST',   'header'
=> 'Content-type:application/x-www-form-urlencoded',   'content' =>
http_build_query($info),   'timeout' => 20 ) )); $result =
file_get_contents($url, false, $context);
 

3.下载图片

file_put_contents('aa.jpg',file_get_contents('https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2310514390,3580363630&fm=27&gp=0.jpg'));
提供免费API接口:http://www.wangshuwen.com/portal/article/detail/id/12.html
<http://www.wangshuwen.com/portal/article/detail/id/12.html> 

友情链接
ioDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信