<?php $wage=array( '市场部'=>array( array(1,'高某','市场部经理','5000'), array(2,'罗某','职员',3000), array(3,'冯某','职员',2500) ), '产品部'=>array( array(1,'李某','产品部经理','5000'), array(2,'张某','职员',3000), array(3,'王某','职员',2500) ), '财务部'=>array( array(1,'徐某','财务部经理','5000'), array(2,'孙某','职员',3000), array(3,'赵某','职员',2500) ) ); foreach ($wage as $sector => $table){ echo '<table border="1" width="600" align="center">'; echo '<captiom><h1>'.$sector.'十月份工资表</hi></caption>'; echo '<tr bgcolor="#ff0000"><th>编号</th><th>姓名</th><th>职务</th><th>工资</th></tr>'; foreach ($table as $row){ echo '<tr>'; foreach ($row as $col){ echo '<td>'.$col.'</td>'; } echo '</tr>'; } echo '</table><br/>'; } ?>
转载于:https://www.cnblogs.com/forphp/p/3448788.html