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

QQ登录

只需一步,快速开始

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

[php学习资料] php post数据

[复制链接]
跳转到指定楼层
楼主
发表于 2018-10-14 00:59:52 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
        $postdata = http_build_query($data);
6 A% n* b& j; ]8 f$ D2 `
# P2 \+ A9 k+ w9 s/ \        $opts = array () V- e+ e, [5 e. Y& T) }% z0 ?
        'http' => array (  P9 E3 ~$ d# U
        'method' => 'POST',, k; h0 z$ o) i4 P4 x8 Q2 s. B( X
        'header'=> "Content-type: application/x-www-form-urlencodedrn",: b  Z4 f7 u' b& _) z
        "Content-Length: " . strlen($data) . "rn",
3 ^5 X7 a9 n2 K3 d5 @* G1 ~! P        'content' => $postdata3 e, D2 Q8 I3 h5 K# s( l. n
        )
4 `: F+ `# [) p. H# Y; G0 ?$ _        );4 \3 W3 b1 ?% w. A) Z/ z" K- b9 S
+ \; s+ t  S, r) x
        $context = stream_context_create($opts);
/ w% z1 x/ R6 B: _/ K0 n        $html = file_get_contents($url, false, $context);       
2 F: R; G0 R" q& Z6 Q! L. D' Q; {9 e% R& _: ^
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 支持支持 反对反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

GMT+8, 2026-4-30 21:45 , Processed in 0.060862 second(s), 21 queries .

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