After further troubleshooting, I don't think the problem has anything to do with the code that I posted previously. It seems that it is more likely something to do with the foreach loop that I use to iterate through the $rank array, and use to populate the $result array:
$result = array();
foreach($rank as $percent => $ranked_member) {
if(!isset($result[$ranked_member])) {
$result[$ranked_member] = $percent;
} else {
$result[$ranked_member] += $percent;
}
}
natsort($result);
$result = array_reverse($result, true);
When I add test data to the $rank array, I noticed that if any of the test entries contained matching data in both the key and value, then one of the entries would not be included in the sum.
I think I need to learn more about constructing arrays...
revez