I have tree arrays in php as shown in the code
<?php
//old array
$oldArray = array(0 => 11, 1 => 18, 2 => 29, 3 => 35, 4 => 40);
// held values
$hold = array( 1 => 18, 3 => 35);
// new random generated array
$newValues = array( 0 => 27, 1 => 31, 2 => 38);
//I need keep keys (order, index) of $hold values
newArrayMergedPushed = array(0 => 27, 1 => 18, 2 => 31, 3 => 35, 4 => 38);
?>
I need keep order of $hold array in same order,index like in $oldArray. What function can I use in php so that the following output is obtained without changing key values?