I currently construct a multi-dim array from my input. like so: (example)
<form method=post action="testing.php">
<input name="response[0]['id']" type="hidden" value="<? echo $q1; ?>">
<input name="response[0]['answer']" type=text value=''>
<input name="response[1]['id']" type="hidden" value="<? echo $q2; ?>">
<input name="response[1]['answer']" type=text value=''>
<input name="response[2]['id']" type="hidden" value="<? echo $q3; ?>">
<input name="response[2]['answer']" type=text value=''>
<input name="response[3]['id']" type="hidden" value="<? echo $q4; ?>">
<input name="response[3]['answer']" type=text value=''>
<input type="submit" value="submit">
</form>
so that is successfully be POSTED. However I am trying to use a foreach to print out the values and I am getting it wrong.
EDIT my output array:
Array (
[0] => Array
(
['id'] => q1
['answer'] => 1
)
[1] => Array
(
['id'] => q2
['answer'] => 2
)
[2] => Array
(
['id'] => q3
['answer'] => 3
)
[3] => Array
(
['id'] => q4
['answer'] => 4
)
)
can somebody explain how i would extract the values with a foreach or even a better way?
many thanks