特定の日付 (2013-10-14 など) の tempMaxC を取得したいこの json 結果があります。
私はこれを試しましたが、うまくいきません。
$json=json_decode($json_reply);
printf("<p>Current temp</p>",
$json->{'data'}->{'weather'}['0']->{'date'},
$json->{'data'}->{'weather'}['0']->{'tempMaxC'} );
ジョンソン:
{
"data": {
"current_condition": [
{
"cloudcover": "25",
"humidity": "81",
"observation_time": "08:51 AM",
"precipMM": "0.0",
"pressure": "1019",
"temp_C": "6",
"temp_F": "43",
"visibility": "10",
"weatherCode": "113",
"weatherDesc": [
{
"value": "Sunny"
}
],
"weatherIconUrl": [
{
"value": "http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0001_sunny.png"
}
],
"winddir16Point": "SSW",
"winddirDegree": "210",
"windspeedKmph": "9",
"windspeedMiles": "6"
}
],
"request": [
{
"query": "Adelboden, Switzerland",
"type": "City"
}
],
"weather": [
{
"date": "2013-10-13",
"precipMM": "3.2",
"tempMaxC": "7",
"tempMaxF": "44",
"tempMinC": "0",
"tempMinF": "32",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly Cloudy"
}
],
"weatherIconUrl": [
{
"value": "http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0002_sunny_intervals.png"
}
],
"winddir16Point": "SW",
"winddirDegree": "233",
"winddirection": "SW",
"windspeedKmph": "12",
"windspeedMiles": "7"
},
{
"date": "2013-10-14",
"precipMM": "0.6",
"tempMaxC": "9",
"tempMaxF": "48",
"tempMinC": "0",
"tempMinF": "32",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly Cloudy"
}
],
"weatherIconUrl": [
{
"value": "http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0002_sunny_intervals.png"
}
],
"winddir16Point": "SSW",
"winddirDegree": "213",
"winddirection": "SSW",
"windspeedKmph": "12",
"windspeedMiles": "8"
}
]
}
}