Correction status:qualified
Teacher's comments:
<?php echo '<p><h4 style="color:blue">请选择你的生日</h4></p>'; echo '<p> <lable for="name">姓名</table> <input type="text"> </p>'; $years = range(1990, 2000); echo '<select name="years">'; foreach ($years as $value) { echo '<option>'.$value.'年</option>'; } echo '</select>'; echo ' '; $months = range(1, 12); echo '<select name="months">'; foreach ($months as $value) { echo '<option>'.$value.'月</option>'; } echo '</select>'; echo ' '; $days = range(1, 30); echo '<select name="months">'; foreach ($days as $value) { echo '<option>'.$value.'日</option>'; } echo '</select>'; echo '<br>'; echo '<button style="margin-left:100px">提交</button>'; echo '<hr color="red">'; echo( '<br>'); //用用for循环来实现关联数组的遍历 $index = ['id'=>1, 'name'=>'姓名', 'course'=>'php', 'sex'=>'男']; for ($i=0; $i<count($index); $i++) { echo key($index), ':', current($index),'<br>' ; next($index); } //用while循环来实现 echo '<hr color="red">'; echo( '<br>'); reset($index); $i = 0; while ($i<count($index)) { echo key($index), ':', current($index),'<br>' ; next($index); }$i++;
点击 "运行实例" 按钮查看在线实例