I have two arrays, that I want to merge as one according to keys suffix.
$keys = array(
'staff_first_name' => NULL,
'staff_last_name' => NULL,
'staff_years' => NULL
);
$submitted_values = array(
'first_name' => 'jon',
'last_name' => 'doe',
'years' => 5
);
I understand I could use a function like shown here and modify it.
But is there a native php function that will accomplish this. I attempted to use array_merge_recursive
but after reviewing the documentation It will not do what I need it to.
$wanted_array = array(
'staff_first_name' => 'jon',
'staff_last_name' => 'doe',
'staff_years' => 5
);