xml parsing – Get the forecast from another day from yr.nos API

xml parsing – Get the forecast from another day from yr.nos API

Ive solved it! Heres the working code:

foreach($weather->product->time AS $forecast) {
    $from = $forecast->attributes()->from;
    $to = $forecast->attributes()->to;

    if($from == 2012-11-21T12:00:00Z AND $to == 2012-11-21T12:00:00Z) {
            echo echo $forecast->location->temperature->attributes()->value.° C;
        }
}

xml parsing – Get the forecast from another day from yr.nos API

Leave a Reply

Your email address will not be published.