管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
$postdata = http_build_query($data);
% Z! j! G z( N2 a8 Q. h8 v% ^; l ^0 j
$opts = array (
& d6 f; l, ?+ K, h 'http' => array (1 e4 C$ z( a4 C- a! p
'method' => 'POST',
7 d2 C/ s3 O( Q2 d+ C3 A1 c& B6 y- x 'header'=> "Content-type: application/x-www-form-urlencodedrn",% C& [2 I5 Y' z+ `
"Content-Length: " . strlen($data) . "rn",
3 f$ K6 v X- w, r- { 'content' => $postdata
- D, R6 X+ o, Q( K )
' K5 P* q2 w( }$ m; w5 P );
7 }& [$ E$ I1 f) ^9 p, J& j8 K2 s# O
$context = stream_context_create($opts);
! m D8 W* S, ?# K: H $html = file_get_contents($url, false, $context); , s! K" ]. D5 L
$ U$ |5 T! ~( A) u- F0 U, ^
|
|