simplexml_load_string()的问题

时间:2015-07-25 11:41:51

标签: php xml curl

我正在尝试使用API​​。在这方面,我遇到了simplexml_load_string()的问题。我的代码如下所示

    curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($curl, CURLOPT_USERPWD, $this->_apikey . ":" . $this->_password);        
    $additionalHeaders ='';
    curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', $additionalHeaders));
    curl_setopt($curl,CURLOPT_HTTPGET, 1);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 
    $output = curl_exec($curl);
    curl_close($curl);
    return $xml = simplexml_load_string($output);

我的错误如下所示

ErrorException (E_UNKNOWN) 
simplexml_load_string(): Entity: line 2: parser error : Extra content at the end of the document

在这方面有人能帮助我吗?感谢

0 个答案:

没有答案