<?php
$array = Array("1" => 1, "2" =>4);
$array1 = Array("3" => 5);
$temp = array_merge($array, $array1);
echo json_encode($temp);
?>
It gives the following output
[1,4,5]
but, I need the following output
{"1":1,"2":4,"3":5}
Anyone, please answer this.