The value of phpcheckbox is described in detail. Let's set up an html page. the code is as follows: Copy the code as follows: formediahodpostactionchecktest. phpINPUTnametest [] typecheckboxvalue1INPUTtypecheck sets up an html page. the code is as follows:
The code is as follows:
Note that the name attribute of input is the same for each attribute and is test []. the reason for adding [] is that the content of test is transmitted as an array.
The code of checkTest. php is as follows:
The code is as follows:
Echo implode (",", $ _ POST ['test']);
?>
When outputting content, you only need to use the implode function to convert the array content to a string.
Note: This function can be used to delete multiple records. For example, Delete from tbl where ID in (implode (",", $ _ POST ['test.
Instance code:
The code is as follows:
Untitled Document
The html check box must be in the format of checkbox [] if you want to send a data group to the php script for processing.
// Determine whether to click submit
If ($ _ POST)
{
$ Array = $ _ POST ['checkbox'];
Print_r ($ array );
}
/*
Result:
Array
(
[0] => 1
[1] => 2
[2] => www.jb51.net
[3] => jb51.net
)
A lot of simple things are complicated before they are done, but they are easy to do, just like this check box code.
*/
?>
The signature code is as follows: FORM method = "post" action = "checkTest. php "INPUT name =" test [] "type =" checkbox "value =" 1 "/INPUT type =" check...