我想显示这个json 文件中的以下值。
标题 datum_start datum_end
我
使用
以下代码:
<?php
$nl1jsonurl='http://www.tvgids.nl/json/lists/programs.php?channels=1';
$nl1jsontext=file_get_contents($nl1jsonurl,true);
$nl1 = json_decode($nl1jsontext);
foreach($nl1->1 as $data)
{
echo $data->titel . "\n";
echo $data->datum_start . "\n";
echo $data->datum_end . "\n";
}
?>
示例 JSON:
{
"1": [
{
"db_id": "14612024",
"titel": "NOS Journaal",
"genre": "Nieuws/actualiteiten",
"soort": "",
"kijkwijzer": "",
"artikel_id": null,
"artikel_titel": null,
"datum_start": "2013-07-05 00:10:00",
"datum_end": "2013-07-05 00:35:00"
},
{
"db_id": "14642893",
"titel": "NOS Studio Sportzomer: De Avondetappe",
"genre": "Sport",
"soort": "",
"kijkwijzer": "",
"artikel_id": "58162",
"artikel_titel": "Sprinten in Montpellier",
"datum_start": "2013-07-05 00:35:00",
"datum_end": "2013-07-05 01:30:00"
}
]
}