cncml手绘网

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

作者: admin    时间: 2018-10-14 00:59
标题: php post数据
        $postdata = http_build_query($data);) E# g/ E- v: ^
' ], c- b, S( B! L  @% m5 h
        $opts = array (
+ f" A- k& N3 K; R  ]! F        'http' => array (
$ A+ g1 }9 q3 d9 C        'method' => 'POST',) ~% N2 `0 w! ~/ e; o9 d# J
        'header'=> "Content-type: application/x-www-form-urlencodedrn",1 z2 @* Y  V7 m+ @9 n+ m" v
        "Content-Length: " . strlen($data) . "rn",4 \5 r$ h; X( ?! ?$ r
        'content' => $postdata$ ^$ N% o) I" V9 D# B
        )$ m* q+ |/ t, q( w: g' |  P
        );; B6 J3 v8 R, _/ ^: T2 |7 |
  ?; u) I, N6 A( Q! ?
        $context = stream_context_create($opts);
! j& `* T6 d: B% w" n1 ~8 f        $html = file_get_contents($url, false, $context);        ; H- ]+ |6 n/ d) g

3 V: N% j  N! e




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