Ash*_*kar 3 php google-maps georss
我是geoRss的新手.
我们如何编写geoRss feed.我有我的lat long值和mysql db中的一些其他字段,我想在geoRss feed中添加.
谢谢和问候,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;
Run Code Online (Sandbox Code Playgroud)
替换从数据库中获取的相应字段.
| 归档时间: |
|
| 查看次数: |
1717 次 |
| 最近记录: |