我是 geoRss 的新手。
我们如何编写 geoRss 提要。我在 mysql 数据库中有我的经纬度值和一些其他字段,我想将它们添加到 geoRss 提要中。
感谢和问候, 阿希什
最佳答案
试试这个代码输出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;
替换从您的数据库中获取的相应字段..
关于php - 创建 geoRss 提要,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5645113/