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

QQ登录

只需一步,快速开始

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

[php学习资料] php post数据

[复制链接]
跳转到指定楼层
楼主
发表于 2018-10-14 00:59:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
        $postdata = http_build_query($data);! b( X! n5 H) N2 d0 c0 ?( v$ G
! K; P! j: v" w& {" Q: R+ o
        $opts = array (% |2 s9 k) W2 C7 Z+ r  a) z
        'http' => array (
3 @  m& w+ j! ^5 r* f% C* f        'method' => 'POST',+ K8 y; t/ l( f" E& R
        'header'=> "Content-type: application/x-www-form-urlencodedrn",5 ^! N  m8 @7 K& ?$ e) H
        "Content-Length: " . strlen($data) . "rn",
, N* k0 R/ P3 f0 E4 {" X5 ^) p        'content' => $postdata
: v. Y) ]" a' R" w) Q# U' u        )6 W% ~) X1 n7 o/ t
        );
( T3 C8 V8 q6 t0 q' ~$ L- ^
+ U, X/ F6 V8 E) l, a" d        $context = stream_context_create($opts);
' t+ ~) U  S& H- F: ?8 H' a$ c, e" \        $html = file_get_contents($url, false, $context);        - {- m( Z8 F5 q1 U0 g  E

3 N9 c& \# ?# J3 D9 D2 j
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 支持支持 反对反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

GMT+8, 2026-9-21 05:17 , Processed in 0.048736 second(s), 19 queries .

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