Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个 JSON 文件。
{ "2438": { "open": false, "tag": "borci1", }, "2210": { "open": false, "tag": "Jeskinky", }, }
我知道如何获得例如。“标签”或“打开”,但我怎样才能得到“2438”和“2210”?
json_decode使用 foreach解析 json 后
json_decode
foreach($json as $key=>$value) { //$key is the index of array }
$json_arr=json_decode($string,true); print_r( array_keys($json_arr) );