1
<form id="facform" action="exec/sendfac.php" method="post">
<input id="mbr_id" class="adresse" name="facdatas[][mbr_id]" type="text" value="" readonly="readonly" />
<input id="nom" class="adresse" name="facdatas[][nom]" type="text" value="" readonly="readonly" />
<input id="adresse" class="adresse" name="facdatas[][adresse]" type="text" value="" readonly="readonly"/>
<input id="ville" class="adresse" name="facdatas[][ville]" type="text" value="" readonly="readonly"/>
<input name="facdatas[][concerne]" class="concern" value="" type="text">
<input name="ligneFac[][designation]" type="text" class="facBig" />
<input name="ligneFac[][unite]" type="text" class="facSmall" />
<input name="ligneFac[][quantite]" type="text" class="facSmall" />
<input name="ligneFac[][prixUnite]" type="text" class="facSmall" value="" />
<input name="ligneFac[][taxe]" type="text" class="facSmall" value="" />
<input name="ligneFac[][totLine]" type="text" class="facSmall" value="" />
<input id="send" type="submit" name="submit" value="Envoyer" />
这种形式的形式与这个jQuery
$("#facform").submit(function(e)
{
var nbr_tr = $('#fac_table tr').length;
var sendURL = $(this).attr("action");
var sendPost = $(this).attr("method");
var facArray = $("#facform").serializeArray();
$.ajax(
{
method: "POST",
url: sendURL,
data: facArray,
success: function(response)
{
console.log(response);
$("#facform").submit();
}
});
});
,结果公布给我像每个文本数组即:
Array ([facdatas] => Array ([0] => Array ([mbr_id] => 26) [1] => Array ([nom] => Gautier Albert) [2] => Array ([adresse] => Avenue du Devin du Village 51) [3] => Array ([ville] => 1406 Cronay) [4] => Array ([concerne] => TEST) [5] => Array ([totalFac] => 69.00)) [ligneFac] => Array ([0] => Array ([designation] => Pantalon de training CPNS) [1] => Array ([unite] => pièces) [2] => Array ([quantite] => 1) [3] => Array ([prixUnite] => 69) [4] => Array ([taxe] => 0.00) [5] => Array ([totLine] => 69.00) [6] => Array ([designation] =>) [7] => Array ([unite] =>) [8] => Array ([quantite] =>) [9] => Array ([prixUnite] =>) [10] => Array ([taxe] => 0.00) [11] => Array ([totLine] => 0.00) [12] => Array ([designation] =>) [13] => Array ([unite] =>) [14] => Array ([quantite] =>) [15] => Array ([prixUnite] =>) [16] => Array ([taxe] => 0.00) [17] => Array ([totLine] => 0.00) [18] => Array ([designation] =>) [19] => Array ([unite] =>) [20] => Array ([quantite] =>) [21] => Array ([prixUnite] =>) [22] => Array ([taxe] => 0.00) [23] => Array ([totLine] => 0.00) [24] => Array ([designation] =>) [25] => Array ([unite] =>) [26] => Array ([quantite] =>) [27] => Array ([prixUnite] =>) [28] => Array ([taxe] => 0.00) [29] => Array ([totLine] => 0.00)) [submit] => Envoyer)
似乎每个字符串是一个数组,如果我想的print_r($ _ POST [ '数据'])它是空...
第二个问题是如何使用这个数组在PHP中没有空行?
任何想法??
感谢您的帮助
好的,谢谢,现在我可以有我的数组了,但是如果我使用array_filter结果是空行,你知道我该如何删除空行? – safraga
你能解释更多吗?在哪条线上。 –
这是在我的exec/sendfac.php – safraga