as far as the 2 dimensional array...i don't really know how to create
The code below adds an element to an array $array. This element is itself an array consisting of two elements $a and $b.
$array[] = array($a, $b);
bear in mind that each element of the array is specific, so variable1[0] and variable2[0] are unique and cannot be mixed or matched with any other elements.
That is not a problem. The difference is just that instead of having two arrays to deal with simultaneously, you would now have just one array that combines the two original arrays, element from one array paired with the corresponding element from the other array.