cncml手绘网

标题: php post数据 [打印本页]

作者: admin    时间: 2018-10-14 00:59
标题: php post数据
        $postdata = http_build_query($data);
+ _, \+ C( Y. z9 J" z( K4 S& {; R$ i0 I3 J% v" Q
        $opts = array (, G$ u  d. u$ D+ r/ x- j
        'http' => array (5 A# R3 j6 b& T4 n
        'method' => 'POST',# [! [2 x! R/ c/ y! C0 G
        'header'=> "Content-type: application/x-www-form-urlencodedrn",
8 P  U: B2 h& T! |9 F( ]4 Q0 X/ I        "Content-Length: " . strlen($data) . "rn",
) r; ~$ V- x, T+ Z6 n        'content' => $postdata7 N$ _* F" Z# b5 P4 E  e1 M
        )
0 t# x8 D6 m/ s        );
. Z1 Z6 W; Y+ X% ^4 V7 J3 k* U( C. G, \9 T& k) c1 Q2 h
        $context = stream_context_create($opts);8 v6 p$ B: R' q3 i
        $html = file_get_contents($url, false, $context);       
$ V+ S7 M' @+ B: W9 I% \
$ `" X/ C. n+ N+ X$ h  T/ p1 {




欢迎光临 cncml手绘网 (http://cncml.com/) Powered by Discuz! X3.2