Home  >  Article  >  Backend Development  >  PHP gets $_POST parameter array with the same name_PHP tutorial

PHP gets $_POST parameter array with the same name_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:13:35808browse

When I was writing PHP today, I found that $_POST["arr"] could not obtain the array of parameter arr. Please record it.

For example, the following form needs to be submitted:

 

 

 

 

Using $_POST["arr"] can only get the value of the last selected checkbox. To get the value of all selected checkboxes, you need to modify the form as follows:

 

 

 

 

In this way, you can use $_POST["arr"] to get the values ​​of all selected checkboxes.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440368.htmlTechArticleWhen I was writing PHP today, I found that $_POST["arr"] could not obtain the array of parameter arr, record it. For example, the following form needs to be submitted: input type="checkbox" name="arr" value="" / input type...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn