关于XML的content-type问题

Posted in 技术研究 on August 15th, 2006 by Adam

我们一般用content-type: text/xml来作为XML文件作为header输出,不过可能有些浏览器无法正常下载。Pete向我们建议:

if the user agent contains Mozilla.
So for IE, Firefox, and Safari 1.x my feed will be served in text/xml

other clients will get the proper application/rss+xml MIME type.
Here’s the PHP code:

if(preg_match(‘/mozilla/i’,$_SERVER['USER_AGENT'])){
header(‘content-type: text/xml’);
}else{
header(‘content-type: application/rss+xml’);
}

好像有问题,WP里面没办法加入带有”<和>“的代码?也不能加颜色,怎么办?更新:已解决

Tags:

窄多日记终于开馆,这里是我的自由天空

Posted in 窄多废话 on August 15th, 2006 by Adam

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

先把以前的帖子搬上来先,晕0:40啦,先睡觉,明天再说。
14.jpg 算了太麻烦,放这里旧文档

RSS Feed