Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8848171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:21:52+00:00 2026-06-14T12:21:52+00:00

I’m currently getting data from this API from yr.no’s API for the current time

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:21:54+00:00Added an answer on June 14, 2026 at 12:21 pm

    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';
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to construct a data frame in an Rcpp function, but when I
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.