Yeah I delving into the wonderful world of php. My head was screwed
but i managed to get this function going but still no results. Please
disregaurd top script i think was wrong.

I am wondering if this syntax is correct : $countrycode =  $xml-
>markers['cc'];  or should it be

$countrycode =  $xml->markers[$i]['cc'];  ???



$xml = simplexml_load_file("http://www.travelmapia.com/files/english/
countries.xml");


        $markers = count($xml->marker);

        for ($i = 0; $i < $markers; $i++)
        {


         $countrycode =  $xml->markers['cc'];
         $label = $xml->markers['label'];


         if(strtolower($countrycode) == strtolower($ucountrycode))
         {

           $countryname = $label;

         }
         else{
         }
        }













On Jun 18, 6:16 pm, Rossko <[email protected]> wrote:
> > Any php experts around?
>
> Not really, it's a javascript API forum.
>
> >         for ($i = 0; $i < count($marker); $i++)
> >         {
> >          $countrycode =  $doc->getElementsByTagName("cc");
>
> Within this loop through the array $markers, you keep reading exactly
> the same $countrycode from $doc, over and over again.
> Did you meant to read it from $marker[$i] ?
>
> I would guess that getElement**s**ByTagName is a clue that it will
> return you an array.
>
> >          if(strtolower($ucountrycode) == strtolower($countrycode))
>
> That doesn't look like a sensible operation on an array?
>
> http://www.google.co.uk/search?hl=en&q=php+read+xml+file&meta=&aq=f&oq=
>
> cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to