Heim > Fragen und Antworten > Hauptteil
<?php$arr=array( 'Teaching Department'=>array( , array('Zhang 1','21','Monster'), ), 'Propaganda Department'=>array( array(' Li 2','18','Lady'), array('Gao 2' ,'20','Male'), array('Zhang 2','21','Monster'), ), 'Finanzabteilung '=>array( array('Li 3','18','Man '), array('Gao 3','20','Male'), array('Zhang','21','Yaoren '), ),);foreach($arr as $k=>$ a){echo'<table width="500" border="1">'; echo $k ; b=>$c){ foreach($c as $d=> $ E) {$ i = List ($ One, $ Two, $ Three) = $ e; '. $ i. '& lt;/td & gt;';
autoload2021-09-06 09:42:23
foreach($arr as $k=>$a) { echo''; echo $k ; foreach($a as $b=>$c){ echo "<tr>"; foreach($c as $d=>$e){ $i=list($one,$two,$three)=$e; echo ''.$i.''; echo "</tr>"; } } echo ''; }
在第一层foreach内部的开始和结束分别添加
与即可