Skip to content

Instantly share code, notes, and snippets.

@xatest
Created September 7, 2012 14:07
Show Gist options
  • Save xatest/3666535 to your computer and use it in GitHub Desktop.
Save xatest/3666535 to your computer and use it in GitHub Desktop.
wunderground php api code samples
<?php
$json_string = file_get_contents("http://api.wunderground.com/api/ff45980735b46389/geolookup/conditions/q/IA/Cedar_Rapids.json");
$parsed_json = json_decode($json_string);
$location = $parsed_json->{'location'}->{'city'};
$temp_f = $parsed_json->{'current_observation'}->{'temp_f'};
echo "Current temperature in ${location} is: ${temp_f}\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment