我有以下陣列:轉換字符串數組,每個字符串具有點分隔值,以多維數組
Array
(
[0] => INBOX.Trash
[1] => INBOX.Sent
[2] => INBOX.Drafts
[3] => INBOX.Test.sub folder
[4] => INBOX.Test.sub folder.test 2
)
我怎麼可以這樣數組轉換爲一個多維數組是這樣的:
Array
(
[Inbox] => Array
(
[Trash] => Array
(
)
[Sent] => Array
(
)
[Drafts] => Array
(
)
[Test] => Array
(
[sub folder] => Array
(
[test 2] => Array
(
)
)
)
)
)
[你嘗試過什麼?](http://whathaveyoutried.com)[字符串的 – 2013-02-28 10:08:07
可能重複與陣列結構陣列](http://stackoverflow.com/questions/8537148/string-with-array-structure-to-array) – Jon 2013-02-28 10:32:44
我很難試圖做到這一點!會很酷,看到一個答案.. – 2013-02-28 10:36:43