cncml手绘网
标题:
php post数据
[打印本页]
作者:
admin
时间:
2018-10-14 00:59
标题:
php post数据
$postdata = http_build_query($data);
$ J/ o! h. u- ~7 G6 g8 a
. t: }* K$ V* k4 u3 A
$opts = array (
( q6 }% d! g* R) d
'http' => array (
2 Y7 z7 J. ~' u5 t
'method' => 'POST',
+ u. Z! D1 q, u5 Y3 |
'header'=> "Content-type: application/x-www-form-urlencodedrn",
6 S# T) w8 r$ k& j& s+ j
"Content-Length: " . strlen($data) . "rn",
% C, t* c- v3 f& W1 }4 z
'content' => $postdata
5 i) b* C! J2 |
)
3 j: j* s; ^( Y
);
1 }9 V n: b1 n R
6 @& W1 R0 e; Y" @6 ^4 n
$context = stream_context_create($opts);
% w3 \* ~4 F/ g1 n, b. o$ E+ c& S
$html = file_get_contents($url, false, $context);
t! A% ?( N5 S; O4 A
, _# K1 }6 p+ B7 q0 ~; h
欢迎光临 cncml手绘网 (http://bbs.cncml.com/)
Powered by Discuz! X3.2