$host = 'test.domain.com';

$xmlurl = "http://test.domain.com/prod/test.xml';


if(!($socket = fsockopen($host, 80, $errno, $errstr, 5))) { // URL에 소켓 연결

echo " $errno : $errstr ";

exit;

}


$header = "GET {$xmlurl} HTTP/1.0\n\n";

fwrite($socket, $header);


$data = '';

while(!feof($socket)) { $data .= fgets($socket); }

fclose($socket);


$data = explode("\r\n\r\n", $data, 2);



$xmlObject = simpleXML_Load_String($data[1]);

+ Recent posts