To get more than one check box value in PHP, be sure to add [] to the check box's Name property value
I found the PHP program, in order to get the value of the check box, usually give the check box's Name property plus [], for example:
New User Registration
Can not add, in other ways to replace, because I want to convert the ASP program to PHP program, I hope the HTML file does not change the best.
Also, that is, add this hobby[], the obtained will be the number of groups, not add is not, this and ASP is also different oh, ASP for more than one name attribute value of the same element, gets the always array.
Share to:
------Solution--------------------
There's no way to change that.
------Solution--------------------
If you want to not change the HTML structure and want to get an array of multi-box, then the landlord can use JS to get the value of multi-box and composite JS array, and then pass the value to PHP.
------Solution--------------------
This is a convention of PHP, unless you modify the kernel, you cannot change
But you can also handle the submitted data yourself, hoping you have the ability
For forms
After submission with
Echo UrlDecode (file_get_contents (' php://input '));
You will get a string shaped like this: name=&sex=1&hobby= Music &hobby= Tour
What do we do next? That's your own business.