Home > Backend Development > PHP Tutorial > 求解三维数据变二维数组解决思路

求解三维数据变二维数组解决思路

WBOY
Release: 2016-06-13 13:52:11
Original
914 people have browsed it

求解三维数据变二维数组
此类数组
array (0 => array ('吖' => array (0 => 'a',1 => 'a')),1 => array ('阿' => array (0 => 'a',1 => 'a')))
如何变成
array ('吖' => array (0 => 'a',1 => 'a'),'阿' => array (0 => 'a',1 => 'a'))

------解决方案--------------------

PHP code
$ar = array (0 => array ('吖' => array (0 => 'a',1 => 'a')),1 => array ('阿' => array (0 => 'a',1 => 'a')));
foreach($ar as $v)
 $r[key($v)] = current($v);
print_r($r); <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template