ranking players
Posted: Tue Aug 15, 2006 2:10 am
I have made a php code that will take the value of a persons socre on a text file (where we manually enter the values such as 3 or 10), and use it as a players score. My question is, if possible, how would I rank someone according to there score?
Example:
PlayerA score: 5
PlayerB score: 7
PlayerC score: 0
with ranking php script ->
PlayerB score: 7
PlayerA score: 5
PlayerC score: 0
Here are some notes:
For the php code the players score looks like this
and then this is displayed as text on to an image
Thanks
Example:
PlayerA score: 5
PlayerB score: 7
PlayerC score: 0
with ranking php script ->
PlayerB score: 7
PlayerA score: 5
PlayerC score: 0
Here are some notes:
For the php code the players score looks like this
Code: Select all
$file=("scorecard.txt");
$fileget=file_get_contents($file);
$PlayerAwins = get_data ($fileget, "PlayerAwins = ");
$PlayerBwins = get_data ($fileget, "PlayerBwins = ");
$PlayerCwins = get_data ($fileget, "PlayerCwins = ");Code: Select all
imagettftext ($im, 11, 0, 100, 212, $black, $font, $PlayerAwins);
imagettftext ($im, 11, 0, 200, 212, $black, $font, $PlayerBwins);
imagettftext ($im, 11, 0, 300, 212, $black, $font, $PlayerCwins);Thanks