看板 PHP 關於我們 聯絡資訊
我在Rss Feeds的<description></description>標籤內 想要使用php撈出資料表內的某個欄位的某個數字的字數,做為此RSS的描述 我使用了以下的方式 for迴圈 { 上面為RSS標籤 $summay = strip_tags(substr("$cl_modlog",0,120)); fwrite($fp,'<description>'.$summay.'</description>'."\n"); 下面為RSS標籤 } 奇怪的是,若是直接echo "$summay"; 是可以完整顯示的? 但放在Rss的<description>標籤內 顯示RSS時… 就會出現"此摘要包含錯誤。Internet Explorer 將會稍後再嘗試更新此摘要。" 是<description>不支援big5字碼嗎? (應該不可能啊~~) 請比較精通Rss的網友指點一下 P.S 有上下面二個網站作過功課了,但好像沒特別強調支援的部份... http://cyber.law.harvard.edu/rss/rss.html http://www.xul.fr/en-xml-rss.html#overview 忘了說...是<item></item>內的 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.133.108.182 ※ 編輯: whk 來自: 220.133.108.182 (06/19 16:15) ※ 編輯: whk 來自: 220.133.108.182 (06/19 16:18)
fillano:<?xml....這裡的編碼指定甚麼? 06/19 18:01
yudian:改成:<description><![CDATA[......]]></description>吧! 06/20 12:48
whk :xml的指定編碼是big5 06/23 13:31
whk :感謝yudian提供的方法,用<![CDATA[...]]>解決了! 06/25 19:22