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

QQ登录

只需一步,快速开始

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

[php学习资料] php post数据

[复制链接]
跳转到指定楼层
楼主
发表于 2018-10-14 00:59:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
        $postdata = http_build_query($data);
- t# @' f8 I+ k# N( Q; o% \* e0 W0 n# m/ |: A: U6 h' h, y. }* Z
        $opts = array (
& g2 k; ^9 V# l* H- f) P/ k. V        'http' => array (7 F* Z/ c! c' S9 p3 L2 d# ]
        'method' => 'POST',, x! d5 W& O: K9 U* W$ D
        'header'=> "Content-type: application/x-www-form-urlencodedrn",
0 j+ u  S0 M& j0 S4 A        "Content-Length: " . strlen($data) . "rn",& W5 [3 B1 ~- j, E8 V5 b' ~
        'content' => $postdata
/ B& o0 A2 K/ @! [2 f% c3 t        )5 g2 X, C$ }0 N  h+ B9 n/ t
        );( q) ^4 a) U) p  E. N. d
' `9 p2 u* {3 m% Q; m4 `' r
        $context = stream_context_create($opts);
! q1 F5 `% V, g# c( ~. ^        $html = file_get_contents($url, false, $context);        ' P( e2 i" _7 v, I2 A4 r9 s' e

- Y# t; M) e/ ^! Q" f! ^
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 支持支持 反对反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

GMT+8, 2024-5-20 04:29 , Processed in 0.114130 second(s), 19 queries .

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