使用PHP获取xml文件时遇到问题
当我查看此页面的源代码时,它会显示预期的源代码,一个干净的xml文件 但是,当我尝试这样做时:使用PHP获取xml文件时遇到问题,php,xml,Php,Xml,当我查看此页面的源代码时,它会显示预期的源代码,一个干净的xml文件 但是,当我尝试这样做时: <?php $content = file_get_contents('http://feeds.feedburner.com/Koreus-articles'); echo $content; ?> 我得到了一件可怕的事情:我只是不明白刚才发生了什么 file_get_contents()适用于任何其他简单页面,如www.example.com,但不适用于该xml文
<?php
$content = file_get_contents('http://feeds.feedburner.com/Koreus-articles');
echo $content;
?>
我得到了一件可怕的事情:我只是不明白刚才发生了什么
file_get_contents()适用于任何其他简单页面,如www.example.com,但不适用于该xml文件
感谢您的帮助,谢谢 只需将您的
文件\u get\u contents()
调用更改为simplexml\u load\u file()
,然后您就可以使用print\r
输出整个对象了:
$content = simplexml_load_file('http://feeds.feedburner.com/Koreus-articles');
echo "<pre>";
print_r($content);
echo "</pre>";
$content=simplexml\u load\u文件('http://feeds.feedburner.com/Koreus-articles');
回声“;
打印(内容);
回声“;
既然您是新来的,我建议您在这里参观一下:这样您就可以了解这个网站的工作原理了!(顺便说一句:你可以接受这样的答案:你得到了最大的帮助,解决了你的问题!)