微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

创建geoRss feed

如何解决创建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;
替换从数据库中获取的各个字段。     

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。