这是在学习过程中遇到的需求,平时挺少想到,感觉还挺重要的,所有专门写一篇文章来介绍
如: <form action="" method="post"> <input type="text" name="sort" value="3"> <input type="text" name="sort" value="1"> <input type="text" name="sort" value="0"> <input type="text" name="sort" value="0"> </form>
我需要获取name="sort"的value值
var_dump($_POST);
可以看到结果仅获取一个值
解决办法
在原来的name后面加"“即可
及: <form action="" method="post"> <input type="text" name="sort[]" value="3"> <input type="text" name&