to get all the POST vars into a function, do something like;
foreach($HTTP_POST_VARS as $key => $value)
submitValue($key, $value)
//where $key is the posted var name
//and $value is its content
but you were asking about variable variables.For those you would do somthing like this:
$variableName = "quantity_".$myNumber;
doSomethingWith($$variableName)
//notice the two dolar signs. This means the variable named the string in $variableName