您尚未登录,请登录后浏览更多内容! 登录 | 立即注册

QQ登录

只需一步,快速开始

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 11403|回复: 0
打印 上一主题 下一主题

[php学习资料] php post数据

[复制链接]
跳转到指定楼层
楼主
发表于 2018-10-14 00:59:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
        $postdata = http_build_query($data);
7 S; j  }6 ?: o8 \& L% O) j' j" Y% j8 \0 P
        $opts = array (
0 y, b: J# @; M( S  M( s        'http' => array (
3 \0 a; P% b7 P9 {- \. ?        'method' => 'POST',! j/ P  v+ q, q, t
        'header'=> "Content-type: application/x-www-form-urlencodedrn",, \# H5 e( q$ ^- Y
        "Content-Length: " . strlen($data) . "rn",/ j3 J* }" R+ |2 w7 l5 p4 q
        'content' => $postdata
6 U  X' c/ k0 V" P% \! A4 g        )
$ f; }$ ]) l: n# J( H! M. F7 Q        );7 l' g" c$ \- y' @/ L; d

2 s3 B* F# z7 I# M: o, l        $context = stream_context_create($opts);
0 f) p  w5 n) \5 {4 u: A* d0 ]7 N+ s        $html = file_get_contents($url, false, $context);       
, u8 S& {4 r! U0 v! R. e( {0 @4 ?3 G
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 支持支持 反对反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

GMT+8, 2026-9-21 03:18 , Processed in 0.054610 second(s), 20 queries .

Copyright © 2001-2026 Powered by cncml! X3.2. Theme By cncml!