我是 geoRss 的新手。
我们如何编写 geoRss 提要。我在 mysql db 中有我的 lat long 值和一些其他字段,我想将它们添加到 geoRss 提要中。
谢谢和问候, Ashish
我是 geoRss 的新手。
我们如何编写 geoRss 提要。我在 mysql db 中有我的 lat long 值和一些其他字段,我想将它们添加到 geoRss 提要中。
谢谢和问候, Ashish
试试这个代码输出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;
替换从数据库中获取的相应字段..