缘来路过 发表于 2017-4-3 15:03:58

PHP 原生代码生成 RSS 文档

  <?php
header("Content-Type:text/xml; charset=gb2312");
echo "<?xml version=\"1.0\" encoding=\"gb2312\"?>\n";
echo "<rss version=\"2.0\">\n";
echo "<channel>\n";
echo "<title><!]></title>\n";
echo "<description><!]></description>\n";
echo "<link>http://why100000.com/</link>\n";
echo "<language>zh-cn</language>\n";
echo "<docs>WHY100000.COM Document Center</docs>\n";
echo "<generator>Rss Generator By WWW.WHY100000.COM</generator>\n";
  $title = "PPS 有图像没声音的四个解决方法";
$link = "http://www.why100000.com/show_answer.asp?autoid=1046&amp;Path=_oa";
$description = "PPS 有图像没声音的四个解决方法:今天打开PPS,发现只有图像却听不到声音,其他的程序声音都是正常的,说明是PPS的问题了,那么怎么样解决这…\n";
$author = "why100000.com";
$pubDate = "2008-4-20 18:22:28";
create_item($title, $link, $description, $author, $pubDate);
  echo "</channel></rss>\n";
  function create_item($title_data, $link_data, $description_data, $author_data, $pubDate_data)
{
echo "<item>\n";
echo "<title><!]></title>\n";
echo "<link><!]></link>\n";
echo "<description><!]></description>\n";
echo "<author><!]></author>\n";
echo "<pubDate><!]></pubDate>\n";
echo "</item>\n";
}
?>
页: [1]
查看完整版本: PHP 原生代码生成 RSS 文档