Simple PHP to get the value code of the check box_PHP tutorial

WBOY
Release: 2016-07-13 10:44:51
Original
941 people have browsed it

In PHP, we generally use the array form to do the checkbox checkbox. In this way, when we get the checkbox value in PHP, we will store it in the array form, so we only need to traverse the array to achieve it.




The code is as follows
 代码如下 复制代码



获取复选框的值



1
2
3




Copy code

 代码如下 复制代码

foreach($_POST['year'] as $item){
echo $item."
";
}
?>



Get the value of the check box



1   
2   
3

The code is as follows Copy code
foreach($_POST['year'] as $item){
echo $item."
";
}
?>
http://www.bkjia.com/PHPjc/633081.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/633081.htmlTechArticleIn php, we generally use the array form to get the checkbox checkbox. We will store the selection box value in the form of an array, so we only need to traverse the array to achieve...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template