cncml手绘网
标题:
php post数据
[打印本页]
作者:
admin
时间:
2018-10-14 00:59
标题:
php post数据
$postdata = http_build_query($data);
2 K; H/ O. |0 W6 G/ j' h3 x
, p' I5 N6 i; V" n( i
$opts = array (
/ {$ t" U5 a$ Z2 f
'http' => array (
4 c B: Y, @4 a( I: ]$ I% d
'method' => 'POST',
9 H$ b9 J6 M5 O% _5 y4 L; g
'header'=> "Content-type: application/x-www-form-urlencodedrn",
8 o+ U2 e; K& u
"Content-Length: " . strlen($data) . "rn",
* Q" T1 v$ k) B% a# t' ^$ Z
'content' => $postdata
8 x8 [/ @9 z+ D- k
)
5 \4 b7 ]; ?6 F, F4 w- G( H
);
5 y8 _6 ]8 q/ ]0 ~2 d
r+ |# H% d" ?- A3 x
$context = stream_context_create($opts);
. s3 q! s- [8 c0 f
$html = file_get_contents($url, false, $context);
/ z: M f; e3 }9 a( g
, b* e& e5 ^# O# O) {. e0 v
欢迎光临 cncml手绘网 (http://www.cncml.com/)
Powered by Discuz! X3.2