cncml手绘网
标题:
php post数据
[打印本页]
作者:
admin
时间:
2018-10-14 00:59
标题:
php post数据
$postdata = http_build_query($data);
1 P- H0 X/ ` z7 w4 l0 H5 ?7 ]
7 c8 L3 k( i3 ?/ W* f
$opts = array (
/ C: G# k/ x5 t6 L5 w" _
'http' => array (
( t: ]* e1 ~4 \! R
'method' => 'POST',
& `0 A5 L m% ?2 ?% I
'header'=> "Content-type: application/x-www-form-urlencodedrn",
/ H7 w7 t" i" q; K& q1 g" Y5 z6 T
"Content-Length: " . strlen($data) . "rn",
I) V2 G7 U% [8 n# I/ r
'content' => $postdata
& `5 t0 @" P6 A" \" t7 ^
)
+ f; u/ U8 U" t
);
) l7 i- _4 U2 o8 r9 j
, K( h) F2 @6 V" ]1 k! B. l0 ^
$context = stream_context_create($opts);
2 r% B4 \ m8 P4 |
$html = file_get_contents($url, false, $context);
4 D, R. j- x+ }' W2 ~4 V C
( U$ S$ e* L6 e! i, b& b, ^ ^
欢迎光临 cncml手绘网 (http://bbs.cncml.com/)
Powered by Discuz! X3.2