为什么我的ECHO不打印值1?
<dl><input type='checkbox' class='tinyField' name="informTktUpdate['hd']" value="1" /> Inform user by email</dl>
<dl><input type='checkbox' class='tinyField' name="informTktUpdate['prog']" value="1" /> Inform programmer by email</dl>
echo ($_POST['informTktUpdate']['prog']);
如果我正在使用“print_r(($ _ POST ['informTktUpdate'])”我得到:
Array ( ['hd'] => 1 ['prog'] => 1 )
答案 0 :(得分:2)
删除HTML部分中数组键周围的引号。 它必须是
<input type='checkbox' class='tinyField' name="informTktUpdate[hd]" value="1" />