创建geoRss feed

问题描述

| 我是geoRss的新手。 我们如何编写geoRss提要。我有我想添加到geoRss feed中的lat long值和mysql db中的其他一些字段。 谢谢并恭祝安康, 阿什什     

解决方法

尝试使用此代码输出geoRSS
header(\"Content-type: text/xml\");
    $xml_output = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\";
    $xml_output .= \"<rss version=\\\"2.0\\\" 
      xmlns:geo=\\\"http://www.w3.org/2003/01/geo/wgs84_pos#\\\" 
      xmlns:dc=\\\"http://purl.org/dc/elements/1.1/\\\">\";

    $xml_output .= \"<channel>\";
    $xml_output .= \"<title>My GeoRSS</title>
     <description>Description here</description>
     <link>http://url-here.com/</link>
     <dc:publisher>your_name</dc:publisher>
     <pubDate>Wed,13 Apr 2011 23:56:15 PST</pubDate>
     <item>
       <pubDate>Wed,13 Apr 2011 23:56:15 PST</pubDate>
       <title>Feed title</title>
       <description>Feed description</description>
       <link>Feed URL</link>
       <geo:lat>Latitude</geo:lat>
       <geo:long>Longitude</geo:long>
     </item>
   </channel>
</rss>
\";

print $xml_output;
替换从数据库中获取的各个字段。     

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...