Hello i want to parse the stats table from wunderground to a PHP table array,
what would be the best day to do this?
Thank you!

    "Best" is subject to a lot of variables, but pending more information, I'd probably look into using the [man]DOM[/man] extension to parse the page and then gather the desired details. Alternatively, you could just grab the page into a single string (e.g. via [man]file_get_contents[/man]) and hack away at it with [man]PCRE[/man] functiond and other string functions to grab the desired data.

      which would be the easiest way?
      is there a tutorial or a book for more help on this subject? 🙂
      thanks!!!

        I'm not sure which is easier, as they are rather different approaches and it might depend on what sort of experience you have with object-oriented code (DOM) or regular expressions (PCRE). I don't know of any tutorials off-hand, though if you google for something like "php screen scraping" you may find something useful. And don't forget this forum's search facility, too. 🙂

        I'd probably go the DOM route myself, just because it's...oh, I don't know...more elegant?

          😉 thanks!
          one more question i used this

          <?php
          include('simple_html_dom.php');

          // Create DOM from URL or file
          $dom = file_get_dom('http://www.wunderground.com/cgi-bin/findweather/getForecast?query=larisa');

          // Find all <img>
          foreach($dom->find('span[pwsvariable=humidity]') as $humid)
          echo $humid->value . '%<br>';

          $dom->clear();
          unset($dom);
          ?>

          how could i make it write what it found to an array table called $humid

            foreach($dom->find('span[pwsvariable=humidity]') as $humidity) {
                echo $humidity->value . '%<br>';
                $humid[] = $humidity->value;
            }
              7 days later
              Write a Reply...