I have an array like this:
array(
'1' => 'Item 1',
'2' => 'Item 2',
'3' => 'Item 3',
'4' => 'Item 4',
'5' => 'Item 5',
'6' => 'Item 6',
'7' => 'Item 7',
'8' => 'Item 8',
'9' => 'Item 9'
);
I want to separate this into 3 arrays where keys 1,2,3 go into $array1,$array2,$array3 respectively and then keys 4,5,6 and then 7,8,9 go into $array1,$array2,$array3 respectively too.
So, the final output would be:
$array1 = array(
'1' => 'Item 1',
'2' => 'Item 4',
'3' => 'Item 7'
);
$array2 = array(
'1' => 'Item 2',
'2' => 'Item 5',
'3' => 'Item 8'
);
$array3 = array(
'1' => 'Item 3',
'2' => 'Item 6',
'3' => 'Item 9'
);
Or, if they keys are preserved (and not 1,2,3 in each array as in my example) then that wouldn't matter either. Either way is fine.