当前位置:首页 > 公司荣誉 >

php生成rss订阅

php生成rss订阅 //$news为重数据库里取出的数组

$host = $_SERVER['HTTP_HOST'];

$xmls = '<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:dc="" xmlns:trackback="" xmlns:wfw="" xmlns:slash="">

<channel>';

foreach ($news as $keys => $values) {

//foreach ($values as $key1 => $value1) {

$xmls .= "<item><title>".$values["title"]."</title>";

$xmls .= "<link>$host/news.php?id=".$values['id']."</link>";

//$xmls .= "<description><![$value1[description]]></description>";

//$xmls .= "<pubDate>".$values["addtime"]."</pubDate>";

$xmls .= "<dc:creator>$host</dc:creator>";

//$xmls .= "<description>".$values["addtime"]."</description>";

$xmls .= "<category><![CDATA[".$values["content"]."]]></category></item>";

//$xmls .= "</channel>";

//}

}

$xmls .= "</channel></rss>";

企业建站2800元起,携手武汉肥猫科技,做一个有见地的颜值派!更多优惠请戳:仙桃SEO http://xiantao.4567w.com

上一篇:各种数据类型在jvm里的内存分配

下一篇:最后一页

相关文章