cncml手绘网

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

作者: admin    时间: 2018-10-14 00:59
标题: php post数据
        $postdata = http_build_query($data);
# ?% n3 E  L, _6 |6 V0 }6 t% E$ n" c+ D; i$ i
        $opts = array (
$ H, i$ N( N+ M' Q        'http' => array ($ }9 E; K; l. L" {1 U
        'method' => 'POST',
9 `/ Q4 ]( h0 e        'header'=> "Content-type: application/x-www-form-urlencodedrn",
: E& x% ]  h9 @8 D        "Content-Length: " . strlen($data) . "rn",
( r* @& x4 X1 N/ ^1 Z! G+ i( e( w        'content' => $postdata
' J2 Q4 s/ U" J3 z& b        ): Z2 _5 \2 o: a
        );, q" J/ t) \* u$ ^  Z

$ |3 ]$ U9 o; a' Y2 Q( W! x        $context = stream_context_create($opts);2 d% C/ e: b6 K+ |( p$ Q1 R
        $html = file_get_contents($url, false, $context);       
5 P* V8 s1 `# E* y4 O8 e$ k+ Y1 q. U0 O5 X7 s& i





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