<?php

function cmp ($a, $b) {
  
  if ($a["score"] > $b["score"]) {
	
	return -1;
  }
	
  if ($a["score"] < $b["score"]) {
	
	return 1;
  }
	
	if ($a["score"] == $b["score"]) {
	
	return 0;
  } 	
}
  
function farben($string) {

  $string = str_replace("^0", "<font color=\"lightgray\">", $string);
  $string = str_replace("^1", "<font color=\"red\">", $string);
  $string = str_replace("^2", "<font color=\"green\">", $string);
  $string = str_replace("^3", "<font color=\"yellow\">", $string);
  $string = str_replace("^4", "<font color=\"blue\">", $string);
  $string = str_replace("^5", "<font color=\"lightblue\">", $string);
  $string = str_replace("^6", "<font color=\"magenta\">", $string);
  $string = str_replace("^7", "<font color=\"white\">", $string);
  $string = str_replace("^8", "<font color=\"lightgray\">", $string);
  $string = str_replace("^9", "<font color=\"white\">", $string);
  return $string . "</font>";
}  

function farbig($string) {

  $string = str_replace("^0", "", $string);
  $string = str_replace("^1", "", $string);
  $string = str_replace("^2", "", $string);
  $string = str_replace("^3", "", $string);
  $string = str_replace("^4", "", $string);
  $string = str_replace("^5", "", $string);
  $string = str_replace("^6", "", $string);
  $string = str_replace("^7", "", $string);
  $string = str_replace("^8", "", $string);
  $string = str_replace("^9", "", $string);
  return $string;
}
?>