PHP Help

  • 1
  • Question
  • Updated 7 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("http://api.wunderground.com/api/4b499...;

$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

timbrown

  • 1 Post
  • 0 Reply Likes
  • confused

Posted 7 years ago

  • 1

Be the first to post a reply!