cncml手绘网
标题:
php post数据
[打印本页]
作者:
admin
时间:
2018-10-14 00:59
标题:
php post数据
$postdata = http_build_query($data);
2 X i: H! ~! l& a# Y
& B" k/ \$ I+ ~1 g+ n) U2 N$ ]
$opts = array (
+ M* ~* I9 C- R3 O* v; K
'http' => array (
7 k' i9 z. K( j
'method' => 'POST',
- N- K/ M1 @, t- r4 g5 A
'header'=> "Content-type: application/x-www-form-urlencodedrn",
2 `- f. O8 k- Q1 i
"Content-Length: " . strlen($data) . "rn",
$ s# M$ y% ~) x3 s. W* v
'content' => $postdata
8 w# A" H/ q4 B2 U
)
( a9 Y$ ?3 C1 i2 Y4 J
);
" a% H$ q* j7 r- \% v b+ K
0 Y# L. w& {3 K# u5 Z. ` t
$context = stream_context_create($opts);
" F) w P5 i. G( s+ Z: l
$html = file_get_contents($url, false, $context);
R+ @1 W) \0 A* y' M4 M
3 P' O' l$ S0 A
欢迎光临 cncml手绘网 (http://bbs.cncml.com/)
Powered by Discuz! X3.2