【发布时间】:2014-02-22 09:03:51
【问题描述】:
在我的代码中,当我们单击确定按钮时。它会回显 3
我想申请只计算只有值的输入
怎么办?
<?php
if(isset($_POST["submit"]))
{
echo count($_POST["to_more"]);
}
?>
<form name="f1" method="post">
<input type="text" name="to_more[]">
<input type="text" name="to_more[]">
<input type="text" name="to_more[]">
<input type="submit" name="submit" value="OK">
</form>
【问题讨论】:
-
循环它而不是只有你会得到计数。
-
循环 $_POST['to_more'] ,如果它包含值,则计算它们
标签: php forms input count submit