给定下表...我正在获取每个单元格的值并附加到数据数组...
<table id="ProductTable" width="1200">
<thead>...</thead>
<tbody>
<tr>
<td>SLOTP10</td>
<td>Some Description</td>
<td>Some Qty</td>
<td>Some Price</td>
<td>Some Extended Total</td>
</tr>
</tbody>
<tfoot>...</tfoot>
</table>
// FORM ELEMENTS ARE NOT SHOWN BUT THIS IS VALID
var data = $("#wbmasonorder").serializeArray();
var key = -1;
var products = [];
$('#ProductTable tbody tr td').each(function(index,element) {
if (index % 5 == 0) {
key++;
products[key]=[];
}
products[key].push($(this).html());
});
data.push({
name: 'products',
value: products
});
console.log(data);
$.post(url,data);
当我记录数据时,节点的值在控制台中显示为数组,但是当我发布它时,$_POST['products'] 的值是逗号分隔的字符串......不是数组