在您添加的表单元素中,您会将name=
值放入一个数组中,以便可以处理各种相同的项目。
例如,假设您正在克隆一个表格行。假设这是您要克隆的模板行:
<tr>
<td>
Movie Name: <input type="text" name="mov[]" />
</td>
</tr>
表单发布后,数据将如下所示:
POST DATA:
Array
(
[mov] => Array
(
[0] => (the initial, template row would have no value)
[1] => Gladiator (whatever user typed in)
[2] => Troy (the next movie entered by user...
我用来查看上面 POST 输出的代码如下所示:
If (empty($_POST)===false) {
echo '<pre>';
echo 'POST DATA:<br />';
print_r($_POST);
echo '<br />*********************************************************<br /><br />';
echo 'UPLOADED FILES:<br />';
print_r($_FILES);
echo '</pre>';
die('Dying immed inside IF EMPTY($_POST)===FALSE...');
}