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

QQ登录

只需一步,快速开始

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

[php学习资料] php post数据

[复制链接]
跳转到指定楼层
楼主
发表于 2018-10-14 00:59:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
        $postdata = http_build_query($data);
  @* O2 ]  o8 g/ h% z" F$ P1 j8 N8 o- ^* W+ {  h+ H( M
        $opts = array (
6 b6 [% U$ f* u- r# D        'http' => array (3 C( }8 f7 t0 F* ]
        'method' => 'POST',
. v( A/ L" o* N0 {7 K( ~8 \; i  y. C        'header'=> "Content-type: application/x-www-form-urlencodedrn",
% L9 v# r8 g- z, G9 n        "Content-Length: " . strlen($data) . "rn"," c& E( i6 {9 z. l1 I' d# a
        'content' => $postdata
; k) L* Q( @( O        )
% X& ^- T0 e7 ~6 {        );
) W: q( R# M4 m" P$ E4 [
. [# t! x/ t$ F0 z$ H1 j        $context = stream_context_create($opts);
8 d1 ?6 S1 R& H# T5 ?0 w* S( f5 ^        $html = file_get_contents($url, false, $context);        " Z% J9 q  R$ N% ?& T  f. Q

9 v( j$ z+ |; o# ^$ B
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 支持支持 反对反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

GMT+8, 2024-5-2 13:41 , Processed in 0.129031 second(s), 19 queries .

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