extra content at document using header

eL ogrO

New Member
here is my code\[code\]$ch = curl_init(); //this part we set up curl curl_setopt($ch, CURLOPT_URL,$url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_TIMEOUT, 15);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);$xml_response = curl_exec($ch);curl_close($ch);header('Content-type: application/xml'); //specify as xml to not display as one long stringecho $xml_response; $xml = new SimpleXMLElement($xml_response); //echo back the correct piece of data$result = $xml->xpath('//*[@id="collapsible9"]/div[1]/div[1]/span[2]/text()[1]');while(list( , $node) = each($result)) { echo '//*[@id="collapsible9"]/div[1]/div[1]/span[2]/text()[1]',$node,"\n"; }\[/code\]i need to use the header to set it as xml, then be able to navigate to the correct node and echo the datai am getting the error Extra content at the end of the documentfrom what i understand, i need to specify an end tag for the xml but how to do so?
 
Back
Top