I have the following 2 arrays and would like to combine them. I'm more interested in the keys than their values. I'd like to take this
$arr1 = array(
'tom' => "1",
'sally' => "20" // unique
'larry' => "2",
'kate' => "3",
'dave' => "23" //unique
);
$arr2 = array(
'tom' => "11",
'larry' => "12",
'drummer' => "2", // unique
'kate' => "7",
'nick' => "3" //unique
);
and turn it into something like this
$arr = array(
'tom',
'sally', //unique from arr1, ended up here because she's before larry
'drummer', //unique from arr2, ended up here because he's after larry
'larry',
'kate',
'dave', //unique from arr1, ended up here because he's after the last 2 similar
'nick' //unique from arr2, ended up here because he's after the last 2 similar
);
The trick is I need to insert anything that's unique in the right spot/order based on what's before/after it. Thanks