管理员
   
论坛积分
分
威望 点
贡献值 个
金币 枚
|
$postdata = http_build_query($data);
% l- g, q9 F/ `( R% v" [# D% T( S4 K, X4 V7 b& H( Y
$opts = array (* e- V$ ^( I+ f# k& n: f
'http' => array (
/ O8 b& ]7 o- P' s+ o! F( |* E0 K 'method' => 'POST',
" Q8 A' f. {7 K, q$ i 'header'=> "Content-type: application/x-www-form-urlencodedrn",( H3 d$ q+ f" v* D7 X0 Y0 w
"Content-Length: " . strlen($data) . "rn",* R% j' X- `' _ v; ]; v
'content' => $postdata
* }9 ^6 c% m+ S* r4 v' d5 O! j ) K1 y' |. _5 T$ q& \
);" R% e! a" b9 j, y( H3 W. T. T8 j
8 ?9 n- E% O3 R/ B/ [. ^
$context = stream_context_create($opts);: ~$ g! f5 I& y$ ]7 u
$html = file_get_contents($url, false, $context); ( j0 W: Z3 ^: O
3 W0 G1 {! w+ x( M6 Z
|
|