The example in this article describes how to simply obtain the check box value in PHP. Share it with everyone for your reference, the details are as follows:
html:
<form name="form1" method="post" action="checkbox.php"> <input type=checkbox name=checkbox[] value="1"> <input type=checkbox name=checkbox[] value="2"> <input type=checkbox name=checkbox[] value="3"> <input type=checkbox name=checkbox[] value="4"> <input type=checkbox name=checkbox[] value="5"> <input type="submit" name="button" value="提交" /> </form>
php:
<?php $text1=$_POST['checkbox']; for($i=0;$i<count($text1);$i++) { $yourwant = $text1[$i]; echo $yourwant."<br/>"; } ?>
Readers who are interested in more PHP related content can check out the special topics of this site: "php socket usage summary", " Summary of PHP Network Programming Skills", "Summary of PHP Curl Usage", "Complete PHP Array (Array) Operation Skills", "PHP Data Structure and Algorithm Tutorial", "Summary of PHP Mathematical Operation Skills", "Summary of PHP Date and Time Usage" , "php object-oriented programming introductory tutorial", "php string (string) usage summary", "php + mysql database operation introductory tutorial" and "php common database operation skills summary"
I hope that this article will help everyone with PHP programs Design helps.
The above introduces the simple method of obtaining the check box value in PHP, including the methods of PHP. I hope it will be helpful to friends who are interested in PHP tutorials.