我有一個JS腳本,即時通訊的代碼轉換到PHP,但我堅持的正確語法是創建與此相同的代碼在JS在我的PHP腳本是什麼:設置PHP語法一個變量
var sdata = {
"13":{
"22":["618","22","1","1","0","0","0"],
"21":["617","22","1","1","0","0","0"]
},
"14":{
"22":["619","22","1","1","0","0","0"],
"20":["622","22","1","1","0","0","0"]
},
"15":{
"20":["623","22","1","1","0","0","0"]
}
};
有什麼想法?
如果你想在同一對象轉換在PHP然後使用http://www.php。 net/manual/en/function.json-decode.php,否則請參閱mata的答案。 –
包裝是一個對象,第一個層次也是對象,他們的子元素是數組。你想要完全相同的結構,還是隻想讓數據層保持一致? –
@tpaksu我想它像馬塔回答:)我不解析變量的結果 - 我正在重寫整個腳本:) – Sir