i got just not_so_nice_version:
save your array values:
$player[$number_of_player] = substr("000000000".$earnings , 10);
this function forces that every salary is saved with filling zeros at the beginning and each value has the same size (in this case 10)! There is another, nicer way to do that, but i can't remember.
When output the salary, you can strip the zero's with ereg_replace.