// connect using curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
// put the proxy settings here
curl_setopt($ch, CURLOPT_PROXY,$proxyHost);
curl_setopt($ch, CURLOPT_PROXYPORT,$proxyPort);
// connect with socks5
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// get the response and close curl connection
$data = curl_exec($ch);
curl_close($ch);
// Convert the return to xml object
$sXML = $data;
$oXML = new SimpleXMLElement($sXML);
// show it in the browser, this is optional.
echo '<pre>';
var_dump($oXML);
echo </pre>;
试试这个。请记住,这$oXML
是一个xml 对象,您可以使用->运算符获取对象的子对象。