我有一些重复的表单字段变量,并希望在 POST 之后将它们放入变量中。
$item_code1 = mysql_sanitize( $_POST['item_code1'] );
$units1 = mysql_sanitize( $_POST['units1'] );
$qty1 = mysql_sanitize( $_POST['qty1'] );
$size1 = mysql_sanitize( $_POST['size1'] );
$make1 = mysql_sanitize( $_POST['make1'] );
$finish1 = mysql_sanitize( $_POST['finish1'] );
$item_code2 = mysql_sanitize( $_POST['item_code2'] );
$units2 = mysql_sanitize( $_POST['units2'] );
$qty2 = mysql_sanitize( $_POST['qty2'] );
...
这些表单变量集可以是 1 - 10(或更多)我通过计数器传递了多少组这些表单变量
$ctr_i = mysql_sanitize( $_POST['ctr_i'] );
我如何以编程方式获得上述变量?我的意思是循环$ctr_i
,我想把所有的 POST 值放到 PHP 变量中。
有任何想法吗?