I have an this array (i show it here as a json..):
[
{
"icon1_name":"Home Address A",
"icon2_name":"Home Address B",
"icon3_name":"Home addressC",
},
{
"icon1_name":"OfficeA",
"icon2_name":"OfficeB",
"icon3_name":"OfficeC",
}
]
I'm trying to add an array in the middle (between home address and office). This what i tried to do:
array_splice( $myArray, 1, 0, $arrayToInsert );
But i get the result with numbers:
{
"1":{
"icon1_name":"OfficeA",
"icon2_name":"OfficeB",
"icon3_name":"OfficeC",
"
},
"2":{
"icon1_name":"PhoneA",
"icon2_name":"PhoneB",
"icon3_name":"PhoneC",
"
},
"3":{
"icon1_name":"FaxA",
"icon2_name":"FaxB",
"icon3_name":"FaxC",
}}
How can i do this merge without getting it numbered? Thats mean, keep the original json format.
0and when converted to json make the outter array an array, not an object.