I wouldn't separate these two arrays at all. $close_people is a multidimensional array of the people, all you need to do is add another field to that. Then use a usort to sort them up in a single step.
You can also modify the function so that if the result of $iResult is 0, and the array indexes are valid you can compare the usernames for example. That way if you have two identical similarities, it will be sorted as a secondary using that field.
$close_people[$member['member_id']] = $member;
$close_people[$member['member_id']]['similarity'] = similarity($_SESSION['member_id'], $member['member_id']);
function sortBySimilarityASC($a, $b)
$iResult = 0;
if (isset($a['similarity'], $b['similarity']))
$iResult = $a['similarity'] - $b['similarity'];
function sortBySimilarityDESC($a, $b) // in case you want a desc
return sortBySimilarityASC($b, $a);
You can do this with an array_multisort as well, but I've always used delegate sorting, and honestly don't think I could write an example for a multisort without the data.