ลอง print_r(); เข้าไปเฉพาะ forecasts ก็ขึ้น Error
โค้ด: เลือกทั้งหมด
echo print_r($response['weather_forecast']['forecasts']);
โค้ด: เลือกทั้งหมด
<b>Warning</b>: Illegal string offset 'weather_forecast' in <b>/opt/lampp/htdocs/mindphp/tools/temperatureconvector/testdo.php</b> on line <b>26</b><br />
<br />
<b>Warning</b>: Illegal string offset 'forecasts' in <b>/opt/lampp/htdocs/mindphp/tools/temperatureconvector/testdo.php</b> on line <b>26</b><br />
โค้ด: เลือกทั้งหมด
{
"weather_forecast": {
"locations": [
{
"location": {
"lat": 13.0068,
"lon": 100.0829
},
"forecasts": [
{
"time": "2017-08-17T00:00:00+07:00",
"data": {
"rh": 88.54,
"tc_max": 28.56
}
},
{
"time": "2017-08-18T00:00:00+07:00",
"data": {
"rh": 87.44,
"tc_max": 27.21
}
}
]
}
]
}
}