I have 2 Arrays :
Array
(
[1] => image1
[4] => image2
)
Array
(
[0] => title 1
[2] => title 2
[3] => title 3
)
I just want to merge these arrays and KEEP their key ([1] => image1 will also be at [1] in the new array)
Any idea please ? Thanks !
That should work 🙂
The keys & values from array2 will be appended at the end. If your array is just numeric, you can bring it to the right order with
array_sort().