I got the following array:
$arr = array(6 => 'Somedata', 7 => 'Somedata1', 8 => 'Somedata2');
The problem is that, when I use array_merge( (array) "Select the data", $arr);
, it does change the array keys into:
Array
(
[0] => Not specified
[1] => Somedata
[2] => Somedata1
[3] => Somedata2
)
Is that possible to skip the array_merge
key preversion so the output would look like this?
Array
(
[0] => Not specified
[6] => Somedata
[7] => Somedata1
[8] => Somedata2
)
array_merge
is preserving keys by default – Attributionarray_merge( (array) "Select the data", $arr);
after, andprint_r
dump after that. – ReactionArray("Select the data")
? – Attributionarray_merge($arr, (array) "Select the data");
? – Emmetropia