Q:

Get the forecast from another day from yr.no's API

I'm currently getting data from this API from yr.no's API for the current time and I want to get the temperature from a specific date and time but I don't know how to get this to work.
I want to get this data (which is the forecast for Wednesday):
<time datatype="forecast" from="2012-11-21T15:00:00Z" to="2012-11-21T15:00:00Z">
<location altitude="52" latitude="59.3782" longitude="13.5042">
<temperature id="TTT" unit="celcius" value="7.0"/>
<windDirection id="dd" deg="183.2" name="S"/>
<windSpeed id="ff" mps="3.7" beaufort="3" name="Lett bris"/>
<humidity value="78.3" unit="percent"/>
<pressure id="pr" unit="hPa" value="1020.2"/>
<cloudiness id="NN" percent="100.0"/>
<fog id="FOG" percent="0.0"/>
<lowClouds id="LOW" percent="100.0"/>
<mediumClouds id="MEDIUM" percent="0.0"/>
<highClouds id="HIGH" percent="23.6"/>
</location>
</time>

How can I get this forecast and view it on my site?
Thanks in advance.

A:

I've solved it! Here's 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';
        }
}

