Я пытаюсь разобрать rss xml фидер, но есть некоторый контент отсутствует во время разбора. Я приложил свой rss-канал ниже и ответ на синтаксический анализ, пожалуйста, предложите мне, есть ли другой способ?Как анализировать XML-файл в php?
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<item>
<ids>701</ids>
<post_date>2015-10-30 12:51:30</post_date>
<post_content><blockquote>I personally feel that there is a need to re?invent the very dynamic of contemporary art, to approach it afresh... </blockquote>
Since 2008, the Devi Art Foundation has been making waves as a unique non?profit centre for contemporary artistic practice in India.
<strong>Heading:</strong> As founder of the Devi Art Foundation, you pioneered a unique and avant?
<strong>Anupam Poddar: </strong>There are many factors that culminated in the Foundation being established.
</post_content>
</item>
</channel>
И ответ, как этот
Array
(
[@attributes] => Array
(
[version] => 2.0
)
[channel] => Array
(
[item] => Array
(
[0] => Array
(
[ids] => 701
[post_date] => 2015-10-30 12:51:30
[post_content] => Array
(
[blockquote] => I personally feel that there is a need to re?invent the very dynamic of contemporary art, to approach it afresh...
[strong] => Array
(
[0] => Heading:
[1] => Anupam Poddar:
)
)
)
)
)
)
И мой метод синтаксического анализа является
$xml = simplexml_load_string($details, "SimpleXMLElement", LIBXML_NOCDATA);
$json = json_encode($xml);
$array = json_decode($json, TRUE);
Я понял, что мой ответ был разорен (извините, написал это на мобильном устройстве), поэтому я удалил его. SimpleXML не поддерживает доступ к данным между узлами. Проверьте решение/обходной путь в [этом ответе] (http://stackoverflow.com/a/20177247/2057919). –