&"/> &">

Home >Backend Development >PHP Tutorial >checkboxpreference php checkbox value details

checkboxpreference php checkbox value details

WBOY
WBOYOriginal
2016-07-29 08:43:391198browse

Suppose we have an html page with the following code:

Copy the code The code is as follows:











Pay attention to the name attribute of the input above, each The attribute contents are all the same, and they are all test[]. The reason for adding [] is to transfer the test content into an array. The code content of
checkTest.php is as follows:

Copy the code The code is as follows:


echo implode(",",$_POST['test']);
?>


When we output the content, we only need to use the implode function to convert the array content into a string.
Note: This function can be used in situations such as deleting multiple records. For example, Delete from tbl where ID in (implode(",",$_POST['test'])).
Example code:

Copy code The code is as follows:





Untitled document


html checkbox if you want to send it to php as a data group Script processing must be in the form of checkbox[]



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