Ok, almost got it figured out I think
function cmp($a, $b)
{
return strcmp($a["DKP"], $b["DKP"]);
}
usort($Members, "cmp");
while(list($key, $value) = each($Members))
{
echo "\$Members[$key]: ".$value["Name"].",".$value["ID"].",".$value["Class"].",".$value["DKP"]."\n";
}
The only problem with this is that There is mixed strings and numbers to be sorted. And I would like to be able to pick the desc or asc order. With the usort(), you can't specify your own arguments to the comparison function it looks like. Would like to be able to use some extra arguments like
function cmp($a, $b, $Direction)
{
if($Direction == 0)
return strcmp($a["DKP"], $b["DKP"]);
else
return strcmp($b["DKP"], $a["DKP"]);
}
Or maybe this is completely the wrong way to do this. Someone out there must have an idea. =)