Use this instead;
<?php
$fileContent = file_get_contents ( "serverstatus/fdsstatus.txt" );
$write = explode ( "\n", $fileContent );
$color = array("green", "green", "yellow", "yellow", "red", "red", "green", "green", "green" );
for ( $i = 0; $i < 9; $i++ )
echo "<span style=\"color: $color[$i]\">". $write[$i] ."</span><br>";
?>
The problem with your original code is your trying to write the entire thing for every line you read from the file, which ends up with the entire thing being written in green.
[Updated on: Sun, 23 March 2008 15:23]
Report message to a moderator