SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Threaded View

  1. #1
    SitePoint Evangelist tangledman's Avatar
    Join Date
    Sep 2005
    Puerto de Mazarron, Murcia, Spain
    0 Post(s)
    0 Thread(s)

    What is wrong with me?

    I really don't know why I struggle with this. I think I understand XML. I get some stuff to work and then try something similar and have to bang my head against the desk.

    Please help.

    PHP Code:
        $output $output.'<p><a target="_blank" href="'.$xml_link.'">XML link</a></p>';
    $xml simplexml_load_file($xml_link);
        foreach (
    $xml as $geoname) {
    $lat $geoname->lat;
    $lng $geoname->lng;
    $population $geoname->population;
    $latlon $lat.','.$lng;    
    $output $output.'<p>Population '.$population.'</p><p> Latitude /Longitude '.$latlon.'</p>'
    XML I am parsing is:
    Code XML:
     <toponymName>San Javier</toponymName>
    <name>San Javier</name>
    <fclName>country, state, region,...</fclName>
    <fcodeName>third-order administrative division</fcodeName>
    <adminName3>San Javier</adminName3>
    <alternateName lang="link"></alternateName><timezone dstOffset="2.0" gmtOffset="1.0">Europe/Madrid</timezone>
    Last edited by Mittineague; Jun 16, 2012 at 16:27. Reason: reformatting bbcode tags


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts