I need to add some new values to array by doing something similar.
$array = array();
$array[7] = 'test1';
$array[7] = 'test2';
The problem is that [7] only takes the last value that was added and not test1.
Declare a new (sub)array at the desired offset, and use [] to append new elements to it:
$array = array();
$array[7] = array();
$array[7][] = 'test1';
$array[7][] = 'test2';
print_r($array);
$array[$i][] = 'blahblah'; is that what you mean? I'm a bit confused...