本文介绍了如何遍历PHP多维数组。 共享仅供参考。 具体情况如下。
方法1 :
$a=array('fruits )=array ) a )='Orange ),
' b'='grape ',c='apple ' ),
' numbers '=array (1,2,3,4,5,6 ),
' Holes'=Array ',5='second ',' third ' )
);
Foreach($aas$list=$things )。
if(is_Array($Things ) ) }
foreach ($ things as $ new list=$ counter ) {
echo 'key:'.$newlist.'
'.' value:'.$counter.'
';
() ) ) ) )。
() ) ) ) )。
() ) ) ) )。
方法2 :
functionmulitarraytosingle ($ array ) {
$temp=array (;
if(is_Array($Array ) ) }
Foreach($arrayas$key=$value ) )。
{
if(is_Array($value ) ) }{
mulitarraytosingle($value;
() ) ) ) )。
else{
$temp[]=$value;
() ) ) ) )。
() ) ) ) )。
() ) ) ) )。
() ) ) ) )。
希望本文所述对大家的PHP编程有帮助。