我正試圖解析鏈接下面的JSON文件,但我仍然無法弄清楚解析和顯示它與foreach。JSON解析與PHP foreach
data: [
{
id: "1072",
nik: "013977",
status: "",
name: "RAKHMAT KUSNADI",
birthdate: "1983-10-21",
email: "[email protected]",
first_login: "0",
is_juri: "0",
what_juri: "",
categorized: "0",
back_stage: "0",
placement: [
{
rel_id: "1102",
employee_id: "1072",
department_id: "101",
dept: "Chip",
position_id: "1",
position: ""
}
],
profile_pics: "link"
},
{
id: "1069",
nik: "013377",
status: "",
name: "RENATA MARINGKA",
birthdate: "1987-05-20",
email: "",
first_login: "1",
is_juri: "0",
what_juri: "",
categorized: "0",
back_stage: "0",
placement: [
{
rel_id: "1099",
employee_id: "1069",
department_id: "101",
dept: "Chip",
position_id: "1",
position: ""
}
],
profile_pics: "link"
},
]
}
我想要顯示的姓名和profile_pics地方部門ID是101
有誰知道如何用foreach解析呢?
修訂問題 – 2013-04-24 07:48:01
確保您的JSON驗證。 http://jsonlint.com/ – Fred 2014-10-20 13:33:10