0
如何从XML获取内容元素?计算器上的其它解决方案不能帮助我,我做错了什么。这是我如何阅读提要:如何使用PHP获取XML rss feed的内容元素?
<?php
$content = file_get_contents('some feed url');
$x = new SimpleXmlElement($content);
foreach($x->channel->item as $entry) {
$chi = $entry->children('content', true)->encoded;
}
?>
XML:https://pastebin.com/79dgx8cU
越来越这在$结果:https://pasteboard.co/GAIlxBV.png – EugenA
你应该循环这个'$结果'并投入像我为第0个元素的字符串。 –
我更新了代码,使用更新后的代码。 –