01.
<?php
02.
03.
include
(
'C:\AppServ\simple_html_dom.php'
);
05.
$request
=
""
;
06.
$isRequestHeader
= false;
07.
08.
09.
$exHeaderInfoArr
=
array
();
10.
$exHeaderInfoArr
[] =
"Content-type: text/xml"
;
11.
$exHeaderInfoArr
[] =
"Authorization: "
.
"Basic "
.
base64_encode
(
"authen_user:authen_pwd"
);
12.
13.
$ch
= curl_init();
14.
curl_setopt(
$ch
, CURLOPT_URL,
$urlWithoutProtocol
);
15.
curl_setopt(
$ch
, CURLOPT_POST, 1);
16.
curl_setopt(
$ch
, CURLOPT_POSTFIELDS,
$request
);
17.
curl_setopt(
$ch
, CURLOPT_HEADER, ((
$isRequestHeader
) ? 1 : 0));
18.
curl_setopt(
$ch
, CURLOPT_RETURNTRANSFER, 1);
19.
if
(
is_array
(
$exHeaderInfo
) && !
empty
(
$exHeaderInfo
) )
20.
{
21.
curl_setopt(
$ch
, CURLOPT_HTTPHEADER,
$exHeaderInfo
);
22.
}
23.
$response
= curl_exec(
$ch
);
24.
curl_close(
$ch
);
25.
$html
= str_get_html(
$response
);
26.
$elem
=
$html
->find(
'table td.ms09'
, 0)->plaintext;
27.
28.
29.
$textfile
=
"test.txt"
;
30.
$filew
=
fopen
(
$textfile
,
'w'
);
31.
fwrite(
$filew
,
$elem
);
32.
fclose(
$filew
);
33.
34.
35.
?>