我想能夠解析下面的json數據。它是使用jsonencode從php數組構建的。我已經添加了下面的json來幫助你理解它。我希望能夠以項目符號的形式顯示json。它顯示具有關聯的類別數組和標籤數組的兩條記錄。我打開使用任何庫來幫助。解析由php創建的JSON數據json_encode
{"0":{"categories":[{"name":"Football Club","slug":"football-club"}],"tags":[{"name":"England","slug":"england"},{"name":"EPL","slug":"epl"},{"name":"Europe","slug":"europe"},{"name":"Champions","slug":"champions"}],"ID":"908","post_author":"78350","post_date":"2010-10-18 10:49:16","post_title":"Liverpool Football Club","post_content":"Content goes here...","post_name":"liverpoolfc","guid":"http://www.liverpoolfc.tv","post_type":"post","comment_count":"0","comment_status":"open","relevance_count":0},"1":{"categories":[{"name":"Football Club","slug":"football-club"}],"tags":[{"name":"England","slug":"england"},{"name":"EPL","slug":"epl"},{"name":"Europe","slug":"europe"},{"name":"Champions","slug":"champions"}],"ID":"907","post_author":"78350","post_date":"2010-10-18 10:49:16","post_title":"Everton Football Club","post_content":"Content goes here","post_name":"evertonfc","guid":"http://www.evertonfc.tv","post_type":"post","comment_count":"0","comment_status":"open","relevance_count":0}}
我想能夠解析它並以這樣的方式顯示。
- 利物浦足球俱樂部
- 內容去 這裏
- 分類
- 足球俱樂部
- 標籤
- 英格蘭
- EPL
更新:對不起,我需要解析它在JavaScript中。
'json_decode()'可以用來解析要分析它與PHP或你想服務器端的JSON – 2011-03-02 17:38:07
使用JavaScript創建DOM中的對象? – dmcnelis 2011-03-02 17:43:43
對不起,在客戶端的Javascript。 – madphp 2011-03-02 17:50:24