Eventhough is resolved already.
Nick,
here is fun script, where I use [man]switch[/man] and [man]floor[/man]
to put 5 colors to score levels.
A randomize loop for testing scores and displaying in colors.
<?php
// Script by halojoy
// October 2007
// Create 40 random test values, 0.00-5.00
for($i=0; $i<40; $i++){
$score = rand(0,500)/100;
// $test = round $score downto integer
$test=floor($score);
switch($test){
case 5:
case 4: $col="#ff6600";break; //red
case 3: $col="#0099ff";break; //blue
case 2: $col="#ffff66";break; //yellow
case 1: $col="#66ff66";break; //green
default: $col="#cccccc"; //grey
}
// Display each $score in 5 different color backgrounds!
echo '<span style="font-size:10px;background-color:'.$col.'">';
echo $score;
echo '</span>';
echo '<br />';
}
?>