PHP parsing a georss namespace with simpleXML

后端 未结 1 393
北海茫月
北海茫月 2020-12-21 03:36

Trying to parse out lat/lon from a google maps rss feed:

$file = \"http://maps.google.com/maps/ms?ie=UTF8&hl=en&vps=1&jsv=327b&msa=0&outp         


        
相关标签:
1条回答
  • 2020-12-21 04:34
    <?php 
        $file = "http://maps.google.com/maps/ms?ie=UTF8&hl=en&vps=1&jsv=327b&msa=0&output=georss&msid=217909142388190116501.000473ca1b7eb5750ebfe";
        $xml = simplexml_load_file($file);  
        $loc = $xml->channel->item;  
        foreach ($loc->children('http://www.georss.org/georss') as $geo) { 
            echo $geo;
        } 
    ?>
    
    0 讨论(0)
提交回复
热议问题