我有这样的形式:
<form id="incomes" method="post" action="#">
<input type="text" name="date[]"/>
<input type="text" name="income[]"/>
<input type="text" name="tax[]"/>
<input type="text" name="social_insurance[]"/>
<input type="text" name="health_insurance[]"/>
</form>
我想要做的就是通过 jQuery ajax 将输入发布到 php,结构如下:
Array(
[0] => Array(
date => 2012-12-10
income => 1000
tax => 100
social_insurance => 50
health_insurance => 50
)
[1] Array(
date => 2012-12-15
income => 2000
tax => 150
social_insurance => 20
health_insurance => 50
)
)
有什么简单的方法可以实现吗?我听说过 serialize() 函数,但这不是我想要的......