Home >Backend Development >PHP Tutorial >php checkbox 复选框

php checkbox 复选框

WBOY
WBOYOriginal
2016-06-23 14:32:421824browse

在给checkBox命名时,必须要加"[]" ,但是在接收时不能加"[]" 才能得到值!

例如:

html代码





1   
2   
3





 

result.php 代码:

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

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
Previous article:php学习之旅3Next article:php 使用功能