如何在PHP中解码JSON字符串?

时间:2014-07-24 13:20:15

标签: php json string decode

想要解码这个json字符串。

  

{ “团队”:[[ “Player11的”, “Player27”],[ “Player28”, “Player31”],[ “Player30”, “Player16”],[ “Player26”, “Player6”],[ “Player4”, “Player32”],[ “Player12”, “Player22”],[ “Player7”, “Player10的”],[ “Player17”, “Player2”],[ “Player24”, “Player14”],[ “Player21”, “Player3”],[ “Player25”, “Player20”],[ “Player8”, “Player29”],[ “Player23”, “Player13”],[ “Player15”, “PLAYER1”],[ “Player19”, “Player9”],[ “Player18”, “Player5”]], “结果”:[[[[1,0],[1,0],[1,0],[11,2] ,[1,2],[1,22],[1,22],[2,22],[2,1],[2,1],[2,1],[2,1],[ 2,1],[2,1],[2,1],[2,1]],[[1,2],[1,2],[1,3],[1,4],[ 1,2],[2,1],[2,3],[1,2]],[[1,3],[2,1],[2,1],[2,3], [[1,3],[1,2]],[[1,2],[1,5]]]]}

2 个答案:

答案 0 :(得分:0)

您是否阅读过json_decode的文档? http://php.net/manual/en/function.json-decode.php

答案 1 :(得分:0)

使用PHP的json_decode()函数。它将以数组形式给出结果。