📄 10c02-1.php
字号:
<?php// If we have a 'cities' from the POST, then loop over and display:if (isset($_POST['cities'])) { echo "<p>You claim to have lived in the following cities:"; // Loop over each city and output foreach ($_POST['cities'] as $num => $val) { echo '<br />', ($num + 1), ". {$val}\n"; } echo "</p>\n";}?><form action="<?= $_SERVER['PHP_SELF'] ?>" method="post" name="f1"><p>In order, what are the most recent cities you have lived in?</p><ol><?php// Create a dozen form entries to hold cities:echo str_repeat('<li><input name="cities[]" type="text" /></li>', 12);?></ol><p><input type="submit" /></p></form>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -