简体   繁体   English

使用post发送和打印数组值

[英]send and print array values with post

Why my ECHO doesn't print the value 1 ? 为什么我的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']);

if I'm using "print_r(($_POST['informTktUpdate'])" i get: 如果我使用“ print_r((($ _ POST ['informTktUpdate']))”,我会得到:

 Array ( ['hd'] => 1 ['prog'] => 1 ) 

remove the quotes around array keys in HTML parts. 删除HTML部分中数组键周围的引号。 it have to be 它必须是

<input type='checkbox' class='tinyField' name="informTktUpdate[hd]" value="1" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM