Доброго времени суток. Не получается извлечь данные из xml запроса. Ошибка выглядит следующим образом:
| Цитата | This page contains the following errors: error on line 2 at column 1: Extra content at the end of the document Below is a rendering of the page up to the first error.
|
Код php:
| Код | <?php header("Content-type: text/xml");
function GetAnswer($address, $xml) { $ch = curl_init($address); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 80); curl_setopt($ch, CURLOPT_POST,true); $result=curl_exec($ch); return $result; }
$xml = simplexml_load_file("xmlzapros.xml"); $answer=GetAnswer("https://www.onlinedengi.ru/dev/xmltalk.php", $xml); $xmlres = simplexml_load_string($answer); foreach ($xmlres->rows->row as $row) { echo $row->title. "<br>"; } ?>
|
Xml документ:
| Код | <?xml version="1.0" encoding="UTF-8"?> <request> <action>get_projects_list</action> </request>
|
Пытаюсь извлечь данные вот отсюда https://www.onlinedengi.ru/dev/index.php?id=8 В чем может быть ошибка и как ее исправить? |