I am looking to do something rather straightforward but being new to PHP I'm getting a bit stuck.

I have an html form with radiobuttons that are linked in pairs (input or output). I have linked them (same 'name') so that pressing one effects the other i.e it can only ever be either an input or output never both. These are set up as arrays of two members (input & output)

and goes through a 'for' loop to get both items of the array out and then inserts them into a MySQL table.The problem I am trying to solve is how I can create an array of these radio-button arrays to prevent having to repeat the same code time and time again (I have 16 pairs of buttons!!). I have tried doing what I thought might work