当前位置:首页 > PHP教程 > php应用 > 列表

php生成RSS订阅的方法

发布:smiling 来源: PHP粉丝网  添加日期:2021-05-14 10:30:23 浏览: 评论:0 

这篇文章主要介绍了php生成RSS订阅的方法,较为详细的分析了一个RSS订阅类及其具体使用技巧,非常具有实用价值,需要的朋友可以参考下

本文实例讲述了php生成RSS订阅的方法。分享给大家供大家参考。具体分析如下:

RSS(简易信息聚合,也叫聚合内容)是一种描述和同步网站内容的格式。RSS可以是以下三个解释的其中一个: Really Simple Syndication;RDF (Resource Description Framework) Site Summary; Rich Site Summary。但其实这三个解释都是指同一种Syndication的技术。RSS目前广泛用于网上新闻频道,blog和wiki。使用RSS订阅能更快地获取信息,网站提供RSS输出,有利于让用户获取网站内容的最新更新。网络用户可以在客户端借助于支持RSS的聚合工具软件,在不打开网站内容页面的情况下阅读支持RSS输出的网站内容。

从技术上来说一个RSS文件就是一段规范的XML数据,该文件一般以rss,xml或者rdf作为后缀,下面是一段 rss 文件的内容示例:

  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <rss version="2.0"
  3. <channel> 
  4. <title>php粉丝网</title> 
  5. <link>https://www.phpfensi.com/</link> 
  6. <description>php粉丝网</description> 
  7. <item> 
  8. <title>RSS Tutorial</title> 
  9. <link>网站地址/rss</link> 
  10. <description>New RSS tutorial on W3School</description> 
  11. </item> 
  12. <item> 
  13. <title>XML Tutorial</title> 
  14. <link>网站地址/xml</link> 
  15. <description>New XML tutorial on W3School</description> 
  16. </item> 
  17. </channel> 
  18. </rss> 

下面分享一段使用 php 动态生成 RSS 的代码示例:

  1. <?php 
  2. /** 
  3. ** php 动态生成 RSS 类 
  4. **/ 
  5. define("TIME_ZONE",""); 
  6. define("FEEDCREATOR_VERSION","www.phpfensi.com");//您的网址 
  7. class FeedItem extends HtmlDescribable{ 
  8.     var $title,$description,$link
  9.     var $author,$authorEmail,$image,$category,$comments,$guid,$source,$creator
  10.     var $date
  11.     var $additionalElements=Array(); 
  12.  
  13. class FeedImage extends HtmlDescribable{ 
  14.     var $title,$url,$link
  15.     var $width,$height,$description
  16.  
  17. class HtmlDescribable{ 
  18.     var $descriptionHtmlSyndicated
  19.     var $descriptionTruncSize
  20.  
  21.     function getDescription(){ 
  22.         $descriptionField=new FeedHtmlField($this->description); 
  23.         $descriptionField->syndicateHtml=$this->descriptionHtmlSyndicated; 
  24.         $descriptionField->truncSize=$this->descriptionTruncSize; 
  25.         return $descriptionField->output(); 
  26.     } 
  27.  
  28. class FeedHtmlField{ 
  29.     var $rawFieldContent
  30.     var $truncSize,$syndicateHtml
  31.     function FeedHtmlField($parFieldContent){ 
  32.         if($parFieldContent){ 
  33.             $this->rawFieldContent=$parFieldContent
  34.         } 
  35.     } 
  36.     function output(){ 
  37.         if(!$this->rawFieldContent){ 
  38.             $result=""
  39.         }    elseif($this->syndicateHtml){ 
  40.             $result="<![CDATA[".$this->rawFieldContent."]]>"
  41.         }else
  42.             if($this->truncSize and is_int($this->truncSize)){ 
  43.                 $result=FeedCreator::iTrunc(htmlspecialchars($this->rawFieldContent),$this->truncSize); 
  44.             }else
  45.                 $result=htmlspecialchars($this->rawFieldContent); 
  46.             } 
  47.         } 
  48.         return $result
  49.     } 
  50.  
  51. class UniversalFeedCreator extends FeedCreator{ 
  52.     var $_feed
  53.     function _setFormat($format){ 
  54.         switch (strtoupper($format)){ 
  55.             case "2.0"
  56.                 // fall through 
  57.             case "RSS2.0"
  58.                 $this->_feed=new RSSCreator20(); 
  59.                 break
  60.             case "0.91"
  61.                 // fall through 
  62.             case "RSS0.91"
  63.                 $this->_feed=new RSSCreator091(); 
  64.                 break
  65.             default
  66.                 $this->_feed=new RSSCreator091(); 
  67.                 break
  68.         } 
  69.         $vars=get_object_vars($this); 
  70.         foreach ($vars as $key => $value){ 
  71.             // prevent overwriting of properties "contentType","encoding"; do not copy "_feed" itself 
  72.             if(!in_array($keyarray("_feed","contentType","encoding"))){ 
  73.                 $this->_feed->{$key}=$this->{$key}; 
  74.             } 
  75.         } 
  76.     } 
  77.  
  78.     function createFeed($format="RSS0.91"){ 
  79.         $this->_setFormat($format); 
  80.         return $this->_feed->createFeed(); 
  81.     } 
  82.  
  83.     function saveFeed($format="RSS0.91",$filename="",$displayContents=true){ 
  84.         $this->_setFormat($format); 
  85.         $this->_feed->saveFeed($filename,$displayContents); 
  86.     } 
  87.  
  88.     function useCached($format="RSS0.91",$filename="",$timeout=3600){ 
  89.         $this->_setFormat($format); 
  90.         $this->_feed->useCached($filename,$timeout); 
  91.     } 
  92.  
  93. class FeedCreator extends HtmlDescribable{ 
  94.     var $title,$description,$link
  95.     var $syndicationURL,$image,$language,$copyright,$pubDate,$lastBuildDate,$editor,$editorEmail,$webmaster,$category,$docs,$ttl,$rating,$skipHours,$skipDays
  96.     var $xslStyleSheet=""
  97.     var $items=Array(); 
  98.     var $contentType="application/xml"
  99.     var $encoding="utf-8"
  100.     var $additionalElements=Array(); 
  101.  
  102.     function addItem($item){ 
  103.         $this->items[]=$item
  104.     } 
  105.  
  106.     function clearItem2Null(){ 
  107.         $this->items=array(); 
  108.     } 
  109.  
  110.     function iTrunc($string,$length){ 
  111.         if(strlen($string)<=$length){ 
  112.             return $string
  113.         } 
  114.  
  115.         $pos=strrpos($string,"."); 
  116.         if($pos>=$length-4){ 
  117.             $string=substr($string,0,$length-4); 
  118.             $pos=strrpos($string,"."); 
  119.         } 
  120.         if($pos>=$length*0.4){ 
  121.             return substr($string,0,$pos+1)." ..."
  122.         } 
  123.  
  124.         $pos=strrpos($string," "); 
  125.         if($pos>=$length-4){ 
  126.             $string=substr($string,0,$length-4); 
  127.             $pos=strrpos($string," "); 
  128.         } 
  129.         if($pos>=$length*0.4){ 
  130.             return substr($string,0,$pos)." ..."
  131.         } 
  132.  
  133.         return substr($string,0,$length-4)." ..."
  134.     } 
  135.  
  136.     function _createGeneratorComment(){ 
  137.         return "<!-- generator=\"".FEEDCREATOR_VERSION."\" -->\n"
  138.     } 
  139.  
  140.     function _createAdditionalElements($elements,$indentString=""){ 
  141.         $ae=""
  142.         if(is_array($elements)){ 
  143.             foreach($elements AS $key => $value){ 
  144.                 $ae.= $indentString."<$key>$value</$key>\n"
  145.             } 
  146.         } 
  147.         return $ae
  148.     } 
  149.  
  150.     function _createStylesheetReferences(){ 
  151.         $xml=""
  152.         if($this->cssStyleSheet) $xml .= "<?xml-stylesheet href=\"".$this->cssStyleSheet."\" type=\"text/css\"?>\n"
  153.         if($this->xslStyleSheet) $xml .= "<?xml-stylesheet href=\"".$this->xslStyleSheet."\" type=\"text/xsl\"?>\n"
  154.         return $xml
  155.     } 
  156.  
  157.     function createFeed(){} 
  158.  
  159.     function _generateFilename(){ 
  160.         $fileInfo=pathinfo($_SERVER["PHP_SELF"]); 
  161.         return substr($fileInfo["basename"],0,-(strlen($fileInfo["extension"])+1)).".xml"
  162.     } 
  163.  
  164.     function _redirect($filename){ 
  165.         Header("Content-Type: ".$this->contentType."; charset=".$this->encoding."; filename=".basename($filename)); 
  166.         Header("Content-Disposition: inline; filename=".basename($filename)); 
  167.         readfile($filename,"r"); 
  168.         die(); 
  169.     } 
  170.  
  171.     function useCached($filename="",$timeout=3600){ 
  172.         $this->_timeout=$timeout
  173.         if($filename==""){ 
  174.             $filename=$this->_generateFilename(); 
  175.         } 
  176.         if(file_exists($filename) && (time()-filemtime($filename) < $timeout)){ 
  177.             $this->_redirect($filename); 
  178.         } 
  179.     } 
  180.  
  181.     function saveFeed($filename="",$displayContents=true){ 
  182.         if($filename==""){ 
  183.             $filename=$this->_generateFilename(); 
  184.         } 
  185.         $feedFile=fopen($filename,"w+"); 
  186.         if($feedFile){ 
  187.             fputs($feedFile,$this->createFeed()); 
  188.             fclose($feedFile); 
  189.             if($displayContents){ 
  190.                 $this->_redirect($filename); 
  191.             } 
  192.         }else
  193.             echo "<br /><b>Error creating feed file, please check write permissions.</b><br />"
  194.         } 
  195.     } 
  196.  
  197. class FeedDate{ 
  198.     var $unix
  199.     function FeedDate($dateString=""){ 
  200.         if($dateString==""$dateString=date("r"); 
  201.         if(is_integer($dateString)){ 
  202.             $this->unix=$dateString
  203.             return
  204.         } 
  205.         if(preg_match("~(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s+)?(\\d{1,2})\\s+([a-zA-Z]{3})\\s+(\\d{4})\\s+(\\d{2}):(\\d{2}):(\\d{2})\\s+(.*)~",$dateString,$matches)){ 
  206.             $months=Array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12); 
  207.             $this->unix=mktime($matches[4],$matches[5],$matches[6],$months[$matches[2]],$matches[1],$matches[3]); 
  208.             if(substr($matches[7],0,1)=='+' OR substr($matches[7],0,1)=='-'){ 
  209.                 $tzOffset=(substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60; 
  210.             }else
  211.                 if(strlen($matches[7])==1){ 
  212.                     $oneHour=3600; 
  213.                     $ord=ord($matches[7]); 
  214.                     if($ord < ord("M")){ 
  215.                         $tzOffset=(ord("A") - $ord - 1) * $oneHour
  216.                     } elseif($ord >= ord("M") && $matches[7]!="Z"){ 
  217.                         $tzOffset=($ord - ord("M")) * $oneHour
  218.                     } elseif($matches[7]=="Z"){ 
  219.                         $tzOffset=0; 
  220.                     } 
  221.                 } 
  222.                 switch ($matches[7]){ 
  223.                     case "UT"
  224.                     case "GMT":    $tzOffset=0; 
  225.                 } 
  226.             } 
  227.             $this->unix += $tzOffset
  228.             return
  229.         } 
  230.         if(preg_match("~(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(.*)~",$dateString,$matches)){ 
  231.             $this->unix=mktime($matches[4],$matches[5],$matches[6],$matches[2],$matches[3],$matches[1]); 
  232.             if(substr($matches[7],0,1)=='+' OR substr($matches[7],0,1)=='-'){ 
  233.                 $tzOffset=(substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60; 
  234.             }else
  235.                 if($matches[7]=="Z"){ 
  236.                     $tzOffset=0; 
  237.                 } 
  238.             } 
  239.             $this->unix += $tzOffset
  240.             return
  241.         } 
  242.         $this->unix=0; 
  243.     } 
  244.  
  245.     function rfc822(){ 
  246.         $date=gmdate("Y-m-d H:i:s",$this->unix); 
  247.         if(TIME_ZONE!=""$date .= " ".str_replace(":","",TIME_ZONE); 
  248.         return $date
  249.     } 
  250.  
  251.     function iso8601(){ 
  252.         $date=gmdate("Y-m-d H:i:s",$this->unix); 
  253.         $date=substr($date,0,22) . ':' . substr($date,-2); 
  254.         if(TIME_ZONE!=""$date=str_replace("+00:00",TIME_ZONE,$date); 
  255.         return $date
  256.     } 
  257.  
  258.     function unix(){ 
  259.         return $this->unix; 
  260.     } 
  261.  
  262. class RSSCreator10 extends FeedCreator{ 
  263.     function createFeed(){ 
  264.         $feed="<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"
  265.         $feed.= $this->_createGeneratorComment(); 
  266.         if($this->cssStyleSheet==""){ 
  267.             $cssStyleSheet="http://www.w3.org/2000/08/w3c-synd/style.css"
  268.         } 
  269.         $feed.= $this->_createStylesheetReferences(); 
  270.         $feed.= "<rdf:RDF\n"
  271.         $feed.= "    xmlns=\"http://purl.org/rss/1.0/\"\n"
  272.         $feed.= "    xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n"
  273.         $feed.= "    xmlns:slash=\"http://purl.org/rss/1.0/modules/slash/\"\n"
  274.         $feed.= "    xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n"
  275.         $feed.= "    <channel rdf:about=\"".$this->syndicationURL."\">\n"
  276.         $feed.= "        <title>".htmlspecialchars($this->title)."</title>\n"
  277.         $feed.= "        <description>".htmlspecialchars($this->description)."</description>\n"
  278.         $feed.= "        <link>".$this->link."</link>\n"
  279.         if($this->image!=null){ 
  280.             $feed.= "        <image rdf:resource=\"".$this->image->url."\" />\n"
  281.         } 
  282.         $now=new FeedDate(); 
  283.         $feed.= "       <dc:date>".htmlspecialchars($now->iso8601())."</dc:date>\n"
  284.         $feed.= "        <items>\n"
  285.         $feed.= "            <rdf:Seq>\n"
  286.         for ($i=0;$i<count($this->items);$i++){ 
  287.             $feed.= "                <rdf:li rdf:resource=\"".htmlspecialchars($this->items[$i]->link)."\"/>\n"
  288.         } 
  289.         $feed.= "            </rdf:Seq>\n"
  290.         $feed.= "        </items>\n"
  291.         $feed.= "    </channel>\n"
  292.         if($this->image!=null){ 
  293.             $feed.= "    <image rdf:about=\"".$this->image->url."\">\n"
  294.             $feed.= "        <title>".$this->image->title."</title>\n"
  295.             $feed.= "        <link>".$this->image->link."</link>\n"
  296.             $feed.= "        <url>".$this->image->url."</url>\n"
  297.             $feed.= "    </image>\n"
  298.         } 
  299.         $feed.= $this->_createAdditionalElements($this->additionalElements,"    "); 
  300.  
  301.         for ($i=0;$i<count($this->items);$i++){ 
  302.             $feed.= "    <item rdf:about=\"".htmlspecialchars($this->items[$i]->link)."\">\n"
  303.             //$feed.= "        <dc:type>Posting</dc:type>\n"; 
  304.             $feed.= "        <dc:format>text/html</dc:format>\n"
  305.             if($this->items[$i]->date!=null){ 
  306.                 $itemDate=new FeedDate($this->items[$i]->date); 
  307.                 $feed.= "        <dc:date>".htmlspecialchars($itemDate->iso8601())."</dc:date>\n"
  308.             } 
  309.             if($this->items[$i]->source!=""){ 
  310.                 $feed.= "        <dc:source>".htmlspecialchars($this->items[$i]->source)."</dc:source>\n"
  311.             } 
  312.             if($this->items[$i]->author!=""){ 
  313.                 $feed.= "        <dc:creator>".htmlspecialchars($this->items[$i]->author)."</dc:creator>\n"
  314.             } 
  315.             $feed.= "        <title>".htmlspecialchars(strip_tags(strtr($this->items[$i]->title,"\n\r","  ")))."</title>\n"
  316.             $feed.= "        <link>".htmlspecialchars($this->items[$i]->link)."</link>\n"
  317.             $feed.= "        <description>".htmlspecialchars($this->items[$i]->description)."</description>\n"
  318.             $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements,"        "); 
  319.             $feed.= "    </item>\n"
  320.         } 
  321.         $feed.= "</rdf:RDF>\n"
  322.         return $feed
  323.     } 
  324.  
  325. class RSSCreator091 extends FeedCreator{ 
  326.     var $RSSVersion
  327.  
  328.     function RSSCreator091(){ 
  329.         $this->_setRSSVersion("0.91"); 
  330.         $this->contentType="application/rss+xml"
  331.     } 
  332.  
  333.     function _setRSSVersion($version){ 
  334.         $this->RSSVersion=$version
  335.     } 
  336.  
  337.     function createFeed(){ 
  338.         $feed="<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"
  339.         $feed.= $this->_createGeneratorComment(); 
  340.         $feed.= $this->_createStylesheetReferences(); 
  341.         $feed.= "<rss version=\"".$this->RSSVersion."\">\n"
  342.         $feed.= "    <channel>\n"
  343.         $feed.= "        <title>".FeedCreator::iTrunc(htmlspecialchars($this->title),100)."</title>\n"
  344.         $this->descriptionTruncSize=500; 
  345.         $feed.= "        <description>".$this->getDescription()."</description>\n"
  346.         $feed.= "        <link>".$this->link."</link>\n"
  347.         $now=new FeedDate(); 
  348.         $feed.= "        <lastBuildDate>".htmlspecialchars($now->rfc822())."</lastBuildDate>\n"
  349.         $feed.= "        <generator>".FEEDCREATOR_VERSION."</generator>\n"
  350.  
  351.         if($this->image!=null){ 
  352.             $feed.= "        <image>\n"
  353.             $feed.= "            <url>".$this->image->url."</url>\n"
  354.             $feed.= "            <title>".FeedCreator::iTrunc(htmlspecialchars($this->image->title),100)."</title>\n"
  355.             $feed.= "            <link>".$this->image->link."</link>\n"
  356.             if($this->image->width!=""){ 
  357.                 $feed.= "            <width>".$this->image->width."</width>\n"
  358.             } 
  359.             if($this->image->height!=""){ 
  360.                 $feed.= "            <height>".$this->image->height."</height>\n"
  361.             } 
  362.             if($this->image->description!=""){ 
  363.                 $feed.= "            <description>".$this->image->getDescription()."</description>\n"
  364.             } 
  365.             $feed.= "        </image>\n"
  366.         } 
  367.         if($this->language!=""){ 
  368.             $feed.= "        <language>".$this->language."</language>\n"
  369.         } 
  370.         if($this->copyright!=""){ 
  371.             $feed.= "        <copyright>".FeedCreator::iTrunc(htmlspecialchars($this->copyright),100)."</copyright>\n"
  372.         } 
  373.         if($this->editor!=""){ 
  374.             $feed.= "        <managingEditor>".FeedCreator::iTrunc(htmlspecialchars($this->editor),100)."</managingEditor>\n"
  375.         } 
  376.         if($this->webmaster!=""){ 
  377.             $feed.= "        <webMaster>".FeedCreator::iTrunc(htmlspecialchars($this->webmaster),100)."</webMaster>\n"
  378.         } 
  379.         if($this->pubDate!=""){ 
  380.             $pubDate=new FeedDate($this->pubDate); 
  381.             $feed.= "        <pubDate>".htmlspecialchars($pubDate->rfc822())."</pubDate>\n"
  382.         } 
  383.         if($this->category!=""){ 
  384.             $feed.= "        <category>".htmlspecialchars($this->category)."</category>\n"
  385.         } 
  386.         if($this->docs!=""){ 
  387.             $feed.= "        <docs>".FeedCreator::iTrunc(htmlspecialchars($this->docs),500)."</docs>\n"
  388.         } 
  389.         if($this->ttl!=""){ 
  390.             $feed.= "        <ttl>".htmlspecialchars($this->ttl)."</ttl>\n"
  391.         } 
  392.         if($this->rating!=""){ 
  393.             $feed.= "        <rating>".FeedCreator::iTrunc(htmlspecialchars($this->rating),500)."</rating>\n"
  394.         } 
  395.         if($this->skipHours!=""){ 
  396.             $feed.= "        <skipHours>".htmlspecialchars($this->skipHours)."</skipHours>\n"
  397.         } 
  398.         if($this->skipDays!=""){ 
  399.             $feed.= "        <skipDays>".htmlspecialchars($this->skipDays)."</skipDays>\n"
  400.         } 
  401.         $feed.= $this->_createAdditionalElements($this->additionalElements,"    "); 
  402.  
  403.         for ($i=0;$i<count($this->items);$i++){ 
  404.             $feed.= "        <item>\n"
  405.             $feed.= "            <title>".FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)),100)."</title>\n"
  406.             $feed.= "            <link>".htmlspecialchars($this->items[$i]->link)."</link>\n"
  407.             $feed.= "            <description>".$this->items[$i]->getDescription()."</description>\n"
  408.  
  409.             if($this->items[$i]->author!=""){ 
  410.                 $feed.= "            <author>".htmlspecialchars($this->items[$i]->author)."</author>\n"
  411.             } 
  412.             /* 
  413.              // on hold 
  414.              if($this->items[$i]->source!=""){ 
  415.              $feed.= "            <source>".htmlspecialchars($this->items[$i]->source)."</source>\n"; 
  416.              } 
  417.              */ 
  418.             if($this->items[$i]->category!=""){ 
  419.                 $feed.= "            <category>".htmlspecialchars($this->items[$i]->category)."</category>\n"
  420.             } 
  421.             if($this->items[$i]->comments!=""){ 
  422.                 $feed.= "            <comments>".htmlspecialchars($this->items[$i]->comments)."</comments>\n"
  423.             } 
  424.             if($this->items[$i]->date!=""){ 
  425.                 $itemDate=new FeedDate($this->items[$i]->date); 
  426.                 $feed.= "            <pubDate>".htmlspecialchars($itemDate->rfc822())."</pubDate>\n"
  427.             } 
  428.             if($this->items[$i]->guid!=""){ 
  429.                 $feed.= "            <guid>".htmlspecialchars($this->items[$i]->guid)."</guid>\n"
  430.             } 
  431.             $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements,"        "); 
  432.             $feed.= "        </item>\n"
  433.         } 
  434.         $feed.= "    </channel>\n"
  435.         $feed.= "</rss>\n"
  436.         return $feed
  437.     } 
  438.  
  439. class RSSCreator20 extends RSSCreator091{ 
  440.  
  441.     function RSSCreator20(){ 
  442.         parent::_setRSSVersion("2.0"); 
  443.     } 

使用示例:

  1. <?php 
  2. header('Content-Type:text/html; charset=utf-8'); 
  3. $db=mysql_connect('127.0.0.1','root','123456'); 
  4. mysql_query("set names utf8"); 
  5. mysql_select_db('dbname',$db); 
  6. $brs=mysql_query('select * from article order by add_time desc limit 0,10',$db); 
  7. $rss=new UniversalFeedCreator(); 
  8. $rss->title="页面标题"
  9. $rss->link="网址http://"
  10. $rss->description="rss标题"
  11. while($rowbrs=mysql_fetch_array($brs)){ 
  12.     $item=new FeedItem(); 
  13.     $item->title =$rowbrs['subject']; 
  14.     $item->link='https://www.phpfensi.com/'
  15.     $item->description =$rowbrs['description']; 
  16.     $rss->addItem($item); 
  17. mysql_close($db); 
  18. $rss->saveFeed("RSS2.0","rss.xml");

Tags: php生成RSS订阅

分享到: