PHP 原生代碼產生 RSS 文檔

來源:互聯網
上載者:User

<?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><![CDATA[“十萬個為什麼”電腦學習網-辦公自動化頻道]]></title>/n";
  echo "<description><![CDATA[http://why100000.com]]></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><![CDATA[$title_data]]></title>/n";
    echo "<link><![CDATA[$link_data]]></link>/n";
    echo "<description><![CDATA[$description_data]]></description>/n";
    echo "<author><![CDATA[$author_data]]></author>/n";
    echo "<pubDate><![CDATA[$pubDate_data]]></pubDate>/n";
    echo "</item>/n";
  }
?>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.