How to get dynamic variable name?

Let me explain first:

I have a form that needs to be validated, but the form is built up dynamicly so ofcourse also the name of the inputs are dynamic, like so:


foreach($values as $x) {
	echo "<td class='td_inspring2' align='center'><input name='q" .$i . "' type='text' value='" . $x . "' size='5'></td>";
} //end foreach 2

After submitting the form, it needs to be validated, but how can I a hold of my for example $q0 variable?

In the form I also send the $i value… so I tried something like this:


//$aantal = $i out of form
for($i=0;$i<=$aantal-1;$i++) {
	$field = "q" . $i;
	$value = $_POST['field'];
	echo "Quantity : " . $value . "<br>"; 
}

But this returns nothing , it only outputs: "Quantity : "…

Thanx for your help, Pete :cross-eye