I've got two keyed arrays, say
$a = [ 'Arvind' => 'Basu', 'Rampal' => 'Singh' ];
and
$b = [ 'Anjali' => 'Basu', 'Roopashri' => 'Singh' ];
which I need to merge together in the format
$c = [ 'Arvind' => 'Basu', 'Anjali' => 'Basu' ,'Rampal' => 'Singh', 'Roopashri' => 'Singh' ];
(basically append the two arrays together and sorted according to surnames).
I've tried using the array_merge
function to merge the two arrays, however, that dosen't seem to work.