通过在字段名称中提供键值,如下所示:
<form action="" method="post" id="gr" >
<input type="hidden" name="api_key" value="foobarbaz" />
<input type="hidden" name="gift[amount]" value="1" />
<input type="hidden" name="gift[recipient_email]" value="jerrygarciuh@example.com" />
<input type="hidden" name="gift[recipient_name]" value="Jerry Garciuh" />
<input type="hidden" name="gift[sender_name]" value="Gulf South Thingamabob" />
<input type="hidden" name="gift[message_announce]" value="Oh hai" />
<input type="submit" />
</form>
您可以为后端生成更高度组织的帖子数据关联数组:
Array
(
[api_key] => foobarbaz
[gift] => Array
(
[amount] => 1
[recipient_email] => jerrygarciuh@example.com
[recipient_name] => Jerry Garciuh
[sender_name] => Gulf South Thingamabob
[message_announce] => Oh hai
)
)