hi i need some help parsing a xml file using php , i have tried a few things with no luck , also reading a few tutorials

the xml file is here

http://xoap.weather.com/weather/local/ASXX0112?unit=m&dayf=1par=1005554647&key=3bf3bb307d18fe2c

what i want to do is display only some lines , but im not sure how ..

like
<dnam>Sydney, Australia</dnam>

without the tags of course

if you can help i would appreciate it , i hope you understand , k thnx

tia

    thnx for replying , i have checked that out .. i cant work it out , :S cant get my head around it

      Hrm...

      <?php
      
      $filename = "file.txt";
      
      $data = file_get_contents($filename);
      
      $parser = xml_parser_create();
      
      xml_parser_set_option ( $parser, XML_OPTION_CASE_FOLDING, 0 );
      xml_parser_set_option ( $parser, XML_OPTION_SKIP_WHITE, 1 );
      
      xml_parse_into_struct ( $parser, $data, $vals, $keys );
      
      xml_parser_free ( $parser );
      
      print_r ( $vals );
      
      ?>
      

      Give that a try? Doesn't do too much...

        Originally posted by acey
        -

        Umm ... !! :glare:

          thnx for your help ZibingsCoder have it solved

            Write a Reply...