Summary: for array
{a, b, ..., w, x, ..., z}
insert several elements {m, n, ..., r} at position x , also removing x . Final array:
{a, b, ..., w, m, n, ..., r, ..., z}
Have a return array
$return_arr = array( 'saa'=>'A2223', 'asab'=>'asB', 'wqed'=>'D234', 'wqasee'=>'Esd', 'wqewf'=>'Ffds', 'monwa'=>'monwaaas'
it will return a new array if this element exists in this array 'monwa' => 'monwaaas'.And the new array will be the next order of the element we found for example
if we have $ return_arr => then new_array should be
(add two more element ('hi'=>'HI','hello'=>'HELLO') $new_array = array( 'saa'=>'A2223', 'asab'=>'asB', 'wqed'=>'D234', 'wqasee'=>'Esd', 'wqewf'=>'Ffds', 'hi'=>'HI', 'hello'=>'HELLO' );
And if
$return_arr = array( 'saa'=>'A2223', 'asab'=>'asB', 'monwa'=>'monwaaas',//* 'wqed'=>'D234', 'wqasee'=>'Esd', 'wqewf'=>'Ffds' );
new_array should be:
$new_array = array( 'saa'=>'A2223', 'asab'=>'asB', 'hi'=>'HI', 'hello'=>'HELLO', 'wqed'=>'D234', 'wqasee'=>'Esd', 'wqewf'=>'Ffds' );
And so on ...
Does anyone know how to do this?
thanks