php 一維數組變多維

將下面的數組處理成下圖的樣子php $arr = ['a', 'b', 'c', 'd','e','f']; <?php $arr = ['a', 'b', 'c', 'd','e','f']; $x = []; $y = &$x; $value = 1234; while ($key = current($arr)) { $y[$key] = []; $y = &$y[$key]; next($
相關文章
相關標籤/搜索