How do I see which checkbox is checked?(如何查看哪个复选框被选中?)
问题描述
如何在 PHP 中检查 checkbox
是否被选中?
How do I check in PHP whether a checkbox
is checked or not?
推荐答案
如果复选框被选中,则复选框的值将被传递.否则,该字段不会在 HTTP 帖子中传递.
If the checkbox is checked, then the checkbox's value will be passed. Otherwise, the field is not passed in the HTTP post.
if (isset($_POST['mycheckbox'])) {
echo "checked!";
}
这篇关于如何查看哪个复选框被选中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!