I'm confused. You say you do this:
$data3=array(
[a]=>'test'
=>'test1'
[c]=>'test3'
[a]=>'test4'
[c]=>'test5'
)
But, if you run this....
<?php
$data3=array(
'a'=>'test',
'b'=>'test1',
'c'=>'test3',
'a'=>'test4',
'c'=>'test5'
);
printf("<pre>%s</pre>", print_r($data3, 1));
...you only have 3 array elements (as I would have expected):
Array
(
[a] => test4
[b] => test1
[c] => test5
)