我有一个看起来像的字符串:
["DZ_Backpack_EP1",[["M4A1"],["M16A2]],[["ItemWaterbottle","FoodSteakCooked","ItemPainkiller","ItemSodaPepsi","ItemBloodbag","ItemMorphine","ItemEpinephrine","ItemBandage"],[1,2,1,1,1,1,1,1]]]
Ant我需要获取此数组:
DZ_Backpack_EP1 = array(
['weapons'] => array (
[0] => 'M4A1',
[1] => 'M16A2'
),
['items'] => array (
['ItemsList'] => array (
[0] = > 'ItemWaterbottle',
[1] = > 'FoodSteakCooked',
[2] = > 'ItemPainkiller',
[3] = > 'ItemSodaPepsi',
[4] = > 'ItemBloodbag',
[5] = > 'ItemMorphine',
[6] = > 'ItemEpinephrine',
[7] = > 'ItemBandage'),
['ItemsCount'] => array (
[0] = > 'ItemWaterbottle',
[1] = > 'FoodSteakCooked',
[2] = > 'ItemPainkiller',
[3] = > 'ItemSodaPepsi',
[4] = > 'ItemBloodbag',
[5] = > 'ItemMorphine',
[6] = > 'ItemEpinephrine',
[7] = > 'ItemBandage'
)
)
)
我尝试编辑此示例PHP - string to multidimensional array,但没有运气。 有什么想法吗?