Created
September 7, 2012 14:07
-
-
Save xatest/3666535 to your computer and use it in GitHub Desktop.
wunderground php api code samples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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