I have some repetitive form field variables and want to put them into variable after 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'] );
...
These set of form variables can be 1 - 10 (or more) I am passing how many sets of these form variables through a counter
$ctr_i = mysql_sanitize( $_POST['ctr_i'] );
How do i get the variables like above programatically ?
i mean looping through $ctr_i, i want to put all the POST values to PHP variables.
Any ideas?
extract()function? tried php.net/manual/en/function.extract.php