Im using wunderground.com weather API.
I got JSON to an array.buy i coudlnt echo arrray one by one.
these the sample code to i used in my site$json = file_get_contents("http://api.wunderground.com/api/ab3f1aefcf4033d4/forecast10day/q/CA/San_Francisco.json");
//$phparrya = json_decode($jsonstring);
$array_json=json_decode($json, true);
print_r($obj);
arafath077
0
Light Poster
Recommended Answers
Jump to PostWhat data did you want to extract? The textforecast/forecast data array would be:
$array_json['forecast']['txt_forecast']['forecastday']
For a 10 day forecast this contains 20 items - one daytime and one night for each day. It is number-indexed (0-19)
The simpleforecast/forecast data array would be:
$array_json['forecast']['txt_forecast']['simpleforecast'] …
All 4 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.