So I have two associative arrays with family members and names. Each array have the same index key, but different values. I need to combine the two arrays, remove duplicate values, not duplicate keys, then sort it alphabetical.
So far I have
Array1 = array(
"Grandma"=>"Laurie",
"Grandpa"=>"John",
"Uncle"=>"Jeff",
"Aunt"=>"Julie",
"Cousin1"=>"Julie",
"Cousin2"=>"Anna");
$Array2 = array(
"Grandma"=>"Shannon",
"Grandpa"=>"Phillip",
"Uncle"=>"Mike",
"Aunt"=>"Laurie",
"Cousin1"=>"Anna",
"Cousin2"=>"Jeff",
"Cousin3"=>"Kate");
//Combine the arrays
$array = array_merge_recursive($Mother_side, $Father_side);
So far so good, but then I try:
$Distinct_names = array_unique($array);
and I get errors Notice: Array to string conversion. Any ideas? Thanks.