This works as expected. You are using + to join the arrays and this is the union operator, which adds one array to another but does not overwrite elements with existing keys. Both $remark0 and $remark2 have one element at index 0 - because $remark0 is before $remark2 in your union then the element at index 0 is not overwritten by the value from $remark2. If you want all values to be preserved use array_merge().