PHP Help

  • 1
  • Question
  • Updated 8 years ago
Hey Guys,

I have set up the PHP example on my localhost and it is running perfect.

What i want to do now is display the tempatures for the next 3 days using the 'forecast' id. How do I actually get it to display the weather for the next 3 days?

$json_string = file_get_contents(";

$parsed_json = json_decode($json_string);

$location = $parsed_json->{'location'}->{'city'};
$temp_c = $parsed_json->{'current_observation'}->{'temp_c'};

echo "Current temperature in ${location} is: ${temp_c}&deg\n";
Photo of timbrown


  • 1 Post
  • 0 Reply Likes
  • confused

Posted 8 years ago

  • 1

Be the first to post a reply!