Код: Выделить всё
$ret = file_get_contents($url);
$res = json_encode($ret);
< /code>
, что приводит к следующему json < /p>
{
"2015-12-14":{
"direction":"S",
"snowfall":0.0,
[..]
},
"2015-12-15":{
"direction":"S",
"snowfall":3.0,
[..]
},
"2015-12-12":{
"direction":"SE",
"snowfall":0.0,
[..]
},
"2015-12-13":{
"direction":"S",
"snowfall":0.0,
[..]
},
"2015-12-10":{
"direction":"E",
"snowfall":0.0,
[..]
},
"2015-12-11":{
"direction":"S",
"snowfall":0.0,
[..]
}
}
Подробнее здесь: https://stackoverflow.com/questions/341 ... value-pair