I am looping through an array which itself contains array to find indexes of values 5 & 6.
Upon finding these indexes, I push the matched array, using array_push, into a another array. My application depends on maintaining the array indexes but array_push resets the keys to 0, 1, 2 etc rather than the matched 5, 6, 7 etc.
It feels like a simple problem but I could use some help ....
array_push($array, $new)
, can you do$array[] = $new
or even$array[$key] = $new
(depending on the$key
you want)? – cmbuckley Jan 18 '12 at 22:25