Home  >  Article  >  Backend Development  >  A simple way to get the checkbox value in php, get the checkbox in php_PHP tutorial

A simple way to get the checkbox value in php, get the checkbox in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:52:52937browse

A simple way to get the check box value in php, get the check box in php

The example in this article describes a simple way to get the check box value in php. Share it with everyone for your reference, the details are as follows:

html:

<form id="form1" 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" id="checkbox" value="提交" />
</form>

php:

<&#63;php
$text1=$_POST['checkbox'];
for($i=0;$i<count($text1);$i++)
{
$yourwant = $text1[$i]; 
echo $yourwant."<br/>";
}
&#63;>

Readers who are interested in more PHP-related content can check out the special topics of this site: "Summary of PHP socket usage", "Summary of PHP network programming skills", "Summary of PHP curl usage", "Comprehensive collection of PHP array (Array) operation skills" ", "PHP data structure and algorithm tutorial", "PHP mathematical operation skills summary", "php date and time usage summary", "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 this article will be helpful to everyone in PHP programming.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1125877.htmlTechArticleHow to simply get the check box value in php, get the check box in php. This article describes the simple way to get the check box in php. Frame value method. Share it with everyone for your reference, the details are as follows: html: form id...
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