php课程---数组建立表单
<?php $nation = array( array('n001','汉族'), array('n002','汉族'), array('n003','满族'), array('n004','苗族'), array('n005','维吾尔族') ); echo "<table width='100%' cellpadding='0' cellspacing='0' border='1'>"; echo "<tr><td>代号</td><td>名称</td></tr>"; for($i=0;$i<count($nation);$i++) { echo "<tr><td>".$nation[$i][0]."</td><td>".$nation[$i][1]."</td></tr>"; } echo "</table>"; ?>
运行结果: