The answer?
张桂维
张桂维 2018-10-20 10:46:33
0
2
1234

<?php

$arr=array(

'Teaching Department'=>array(

array('Li',10=> '18','Lady'),

array('Gao','20','Male'),

array('Zhang','21','Monster '),

),

'Propaganda Department'=>array(

array('Li','18','Shemale'),

array('Gao','20','Male'),

array('Zhang','21','Yaoren'),

),

'Finance Department'=>array(

array('Li','18','Lady'),

array('Gao', '20','Male'),

array('Zhang','21','Yaoren'),

),

);

$arr[Propaganda Department][0][0]='Zhang Erwa';

foreach($arr as $value){

foreach($value as $value2 ) {

Foreach ($ Value2 as $ k = & gt; $ v) {

Echo $ k. ';

} }

}

echo '---------Separating line-----------'.'< ;br>';

}

echo '<pre>';

var_dump ($arr);

?>


张桂维
张桂维

reply all(1)
筱笋尖

代码:

foreach($arr as $bum => $b){
        echo $bum.'<br />';
    foreach($b as $bh => $ren){
        echo $bh.'---';
        foreach($ren as  $xx){
            echo  $xx.' ';
        }
        echo '<br />' ;
    }
}

  • reply Let me ask, in the first loop, I know that $bum => $b is a key-value pair (xx department => [someone, age, gender). Then where does the second loop assign the value of $b to $bh=>$ren? I was also confused on the third cycle. . . Ask for answers
    reset author 2018-12-27 20:21:55
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template