<?php //三个同学考试,共考三门课:语文,数学,英语。使用一维整数数组存放三个同学的学号和所有科目的 //考试成绩,以表格输入 $arr=array(1002,78,92,76,1003,67,88,80,1007,90,95,80); echo "<table border='1' align='center' width='400px' cellspacing='0'>"; echo "<tr align='center'>"; echo "<td align='center'>"."学号"."</td>"."<td>"."语文"."</td>"."<td>"."数学"."</td>"."<td>"."英语"."</td>"; for($i=0;$i<count($arr);$i++){ echo "<tr>"; echo "<td>".$arr[$i]."</td>"; $i++; echo "<td>".$arr[$i]."</td>"; $i++; echo "<td>".$arr[$i]."</td>"; $i++; echo "<td>".$arr[$i]."</td>"; echo "</tr>"; } echo "</tr>"; echo "</table>"; ?>
转载于:https://www.cnblogs.com/trueStory/p/3295727.html
转载请注明原文地址: https://win8.8miu.com/read-17146.html