here i've got my array(the ****
are just strings)
[m_timestamp] => ****
[n_id] => ****
[n_name] => ****
[n_material] => ****
[n_neck_finish] => ****
[n_weight] => ****
[n_height] => ****
[n_qty_p_ctn] => ****
[n_ctn_dimensions] => ****
[n_comment] => ****
[sha1] => ****
how can i insert another array:
[n_group] => ****
[n_available] => ****
into the original one so that it looks like:
[m_timestamp] => ****
[n_id] => ****
[n_name] => ****
[n_group] => **** //inserted
[n_available] => **** //inserted
[n_material] => ****
[n_neck_finish] => ****
[n_weight] => ****
[n_height] => ****
[n_qty_p_ctn] => ****
[n_ctn_dimensions] => ****
[n_comment] => ****
[sha1] => ****
i know the key value of where to insert the array(in this case: n_name
)
What i did:
$pos = intval(array_search("n_name", $myarray))+1;
array_splice($myarray, $pos, 0, $insertedarray);
but it doesn't put the $insertedarray
properly, it adds this [0]=>null
in the position I specified
how can i solve this?