Php 具有可变输入值的表单
我有一个表单,它有可变的输入值。例如,一个客户买了5件商品,所以所有这些都显示另一个客户买了3件商品,所以只显示了3件商品。所有这些值都基于数据库Php 具有可变输入值的表单,php,forms,Php,Forms,我有一个表单,它有可变的输入值。例如,一个客户买了5件商品,所以所有这些都显示另一个客户买了3件商品,所以只显示了3件商品。所有这些值都基于数据库 <form id="customer" class="customer" method="post" action=""> <input type="text" name="customer1" value="" > <input type="text" name="customer2" value="
<form id="customer" class="customer" method="post" action="">
<input type="text" name="customer1" value="" >
<input type="text" name="customer2" value="" >
<input type="text" name="customer3" value="" >
</form>
现在我的问题是,每次post变量的数量不同时,如何处理这样的表单。
类似于:
$products = array();
foreach ($_POST as $key => $value) {
array_push($products, $key, $value);
}
谢谢,我明白了,谢谢你的帮助。