Код: Выделить всё
{
"rounds": [
"share_id": "h7ERkA",
"started_at": "2021-06-06 16:03:55 UTC",
"ended_at": "2021-06-06 20:50:05 UTC",
"input_mode": "simple",
"scoring_mode": "stroke_play",
"course": {
"name": "WinterStone Golf Course (18)"
},
"tee": {
"name": "white"
}
]
}
Код: Выделить всё
$file = 'hole19.json';
$jsondata = file_get_contents($file);
$data = json_decode($jsondata, true);
foreach ($data as $row) {
$id = $data['rounds']['share_id']; // Doesn't work
$id = $data['share_id']; // Doesn't work either
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... -using-php
Мобильная версия