首页 > 编程语言 > 详细

php 手册学习 HTML 的 <form> 中建立数组

时间:2019-07-09 19:46:50      阅读:140      评论:0      收藏:0      [点我收藏+]
 1 <!DCOTYPE html>
 2 <html>
 3 <body>
 4 <form action="index.php" method="post">
 5   <input type="text" name="name" />
 6     <select name="var[]" multiple="yes">
 7     <input name="AnotherArray[]" />
 8   <input name="AnotherArray[]" />
 9   <input name="AnotherArray[email]" />
10   <input name="AnotherArray[phone]" />  
11   <input type="image" src="123.jpg" name="foo" />   
12 
13 </form>
14 </body>
15 
16 
17 </html>

返回结果:

array(4) { ["name"]=> string(0) "" ["AnotherArray"]=> array(4) { [0]=> string(2) "21" [1]=> string(2) "12" ["email"]=> string(2) "21" ["phone"]=> string(2) "21" } ["foo_x"]=> string(3) "497" ["foo_y"]=> string(3) "189" }

array(4) { ["name"]=> string(0) "" ["AnotherArray"]=> array(4) { [0]=> string(2) "21" [1]=> string(2) "12" ["email"]=> string(2) "21" ["phone"]=> string(2) "21" } ["foo_x"]=> string(3) "497" ["foo_y"]=> string(3) "189" }

php 手册学习 HTML 的 <form> 中建立数组

原文:https://www.cnblogs.com/gaogaoxingxing/p/11159630.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!