$fp=fsockopen("xxx.xxx.com", 80, $errno, $errstr, 30); if($fp){ $out = "get /abc.xml?key=value http/1.1\r\n"; $out .= "host: xxx.xxx.com\r\n"; $out.= 'user_agent: xml-rpc client\r\n'; $out.='content-type: text/xml\r\n'; $out .= "connection: close\r\n\r\n"; fwrite($fp,$out); while(!@feof($fp)){ $result.=@fgets($fp,1024); } fclose($fp); } echo $result;
相关推荐:
php读取数据的基本操作
以上就是php 远程读取xml 的详细内容。
