cncml手绘网
标题:
php post数据
[打印本页]
作者:
admin
时间:
2018-10-14 00:59
标题:
php post数据
$postdata = http_build_query($data);
- Y# s7 U7 U4 P% m& g' A1 ?6 C- _
) p1 ]' q& c2 `) V/ ?* t' B
$opts = array (
- k; q' S0 y/ q2 ^+ }5 L& p4 J
'http' => array (
( U* c9 y' E8 ^
'method' => 'POST',
J# D- J$ w1 H% m* v- d X
'header'=> "Content-type: application/x-www-form-urlencodedrn",
% o) u2 b1 c+ Z e
"Content-Length: " . strlen($data) . "rn",
* L/ r* ?( s6 g
'content' => $postdata
0 M) F9 g$ e5 L& T
)
! r. k5 `" b4 R
);
: I' i( S+ p5 ~, u' U* G
! H, K% B2 g- ]* _( k
$context = stream_context_create($opts);
& t" |1 I( P& H% ^$ } M
$html = file_get_contents($url, false, $context);
" ^ \' S& b- ~, D
$ X M3 z7 W2 k2 a
欢迎光临 cncml手绘网 (http://bbs.cncml.com/)
Powered by Discuz! X3.2