cncml手绘网
标题:
php post数据
[打印本页]
作者:
admin
时间:
2018-10-14 00:59
标题:
php post数据
$postdata = http_build_query($data);
. s/ b: ]3 R8 x) ~: l1 y J
0 r- B( ~8 [8 ?
$opts = array (
+ a" x5 Q$ ~ a- P
'http' => array (
4 b: ^5 _7 c' c7 Q: x7 q+ W
'method' => 'POST',
2 e( S: s9 |) k7 i' F3 L. k
'header'=> "Content-type: application/x-www-form-urlencodedrn",
# x, v# _( g5 ^
"Content-Length: " . strlen($data) . "rn",
! \5 }3 `# e4 _. r/ c8 C0 m4 H$ u5 T& }
'content' => $postdata
! H' b# e" |8 E8 G5 p
)
( g K2 u& ^, r6 d6 l- p
);
/ T* z( N7 P) x( l
0 ^+ i# A9 A% g
$context = stream_context_create($opts);
" l# J. S2 w/ ~3 u
$html = file_get_contents($url, false, $context);
) V2 X3 v( d/ b7 Z% i" P
% W4 V' f+ Q; V- f0 W2 Y
欢迎光临 cncml手绘网 (http://bbs.cncml.com/)
Powered by Discuz! X3.2