如何在php中从xml中获取数据,在php中创建新页面或url,并显示xml中的完整内容? 乱数假文 2016年1月25日 什么是Lorem Ipsum? Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是行业标准的虚拟文本,当时一位不知名的印刷商拿起一个打印工具,将其拼凑成一本打印样本书。它不仅存活了五个世纪,而且还跨越到电子排版,基本上保持不变。它在20世纪60年代随着包含Lorem Ipsum段落的Letraset表单的发布而流行,最近随着Aldus PageMaker等桌面出版软件的发布,包括Lorem Ipsum版本。

如何在php中从xml中获取数据,在php中创建新页面或url,并显示xml中的完整内容? 乱数假文 2016年1月25日 什么是Lorem Ipsum? Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是行业标准的虚拟文本,当时一位不知名的印刷商拿起一个打印工具,将其拼凑成一本打印样本书。它不仅存活了五个世纪,而且还跨越到电子排版,基本上保持不变。它在20世纪60年代随着包含Lorem Ipsum段落的Letraset表单的发布而流行,最近随着Aldus PageMaker等桌面出版软件的发布,包括Lorem Ipsum版本。,php,xml,Php,Xml,上面的是XML文件。假设文件名为archive.xml <?xml version="1.0" encoding="utf-8"?> <archive> <news category="Lorem"> <headline>Lorem Ipsum</headline> <date>January 25th, 2016</date>

上面的是XML文件。假设文件名为archive.xml

    <?xml version="1.0" encoding="utf-8"?>
       <archive>
         <news category="Lorem">
           <headline>Lorem Ipsum</headline>
           <date>January 25th, 2016</date>
           <sortNews>What is Lorem Ipsum?</sortNews>
           <fullNews><b>Lorem Ipsum</b> is simply dummy text of the printing  and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</fullNews>
         </news>
        </archive>

现在,我想在sortnews之后显示一个链接为ReadMore,打开一个新的php文件或请求一些内容,这样看起来就像这样,并显示完整的新闻文本和其他信息


这可能吗?或者我该怎么做?此外,xml文件中可能有多条新闻

写另一个php文件并添加链接怎么样?你只是在问之前回答了你自己的问题。我明白了。我已经写了代码:)谢谢。写另一个php文件并添加链接怎么样?你只是在问之前回答了你自己的问题。我明白了。我已经写了代码:)谢谢。
             <?php
                    $xmls=simplexml_load_file("newsArchive.xml") or die("Error: Cannot create object");
                    foreach ($xmls as $xml) { 
                      echo "<h4>" . $xml->headline->asXml() . "</h4>";
                      echo "<h5>" . $xml->date->asXml() . "</h5>";
                      echo "<p>" . $xml->sortNews->asXml() . "</p>";
                    }
              ?>