usort sorts the array according to what the 'cmp' function returns.
In your case, you are checking wether $a["9"] is the same as $b["9"].
This is not really correct, because it will return zero if they are not equal, and one if they are.
but, what you should be returning is -1 if one is less than the other, or zero if both are the same, or 1 if one is more than the other.
Read the manual page again, then look at the function below:
http://www.php.net/manual/en/function.usort.php
$playerArray[0][9]= 3;
$playerArray[1][9]=5;
$playerArray[2][9]= 11;
$playerArray[3][9]=2;
$playerArray[4][9]= 15;
echo '<pre>';
usort($playerArray, "cmp");
print_r($playerArray);
function cmp ($a, $b)
{
// Check if they are equal
if ($a[9] == $b[9])
{
// Yes they are equal, return zero
return 0;
}
else
{
// They are not equal, is A larger than B?
if ($a[9] > $b[9])
{
// A is larger than B, return 1
return 1;
}
else
{
// A is not larger than B, and it is not equal, so A must be less than B, return -1
return -1;
};
};
}