表单 php获取从html表单传递的数组
php获取从html表单传递的数组 [代码片段(21行)]
<form method="post" action="arrayformdata.php"> <label>Tags</label> <input type="text" name="tags[]"/> <input type="text" name="tags[]"/> <input type="text" name="tags[]"/> <input type="text" name="tags[]"/> <input type="text" name="tags[]"/> <input type="submit" value="submit"> </form> </html> To receive the array in a php script, we use the $_POST as <pre lang="php"> <?php $postedtags = $_POST['tags']; foreach ($postedtags as $tag){ echo "<br />$tag"; } ?>
精彩图集
精彩文章