标签: php
如何转换:
$arr = array('item1','item2','item3','item4','...');
到此:
$arr2['item1']['item2']['item3']['item4']['...'] = $something;
答案 0 :(得分:4)
$arr2 = $something; foreach (array_reverse($arr) as $key) { $arr2 = array($key => $arr2); }