03-16-2009, 10:09 PM
|
#3 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
How about the following? It looks a little more elegant than a huge switch statement. Village Idiot is also right; please do not remove your questions as it could well help other people in the future.
php Code:
$iDateStatus = 2; $aStatusColours = array('FFFFFF', '000000', 'CCCCCC', '669900'); $szStatusColour = null; if ($iDateStatus != null) /* != "1"? */{ $szStatusColour = isset($aStatusColours[ $iDateStatus] ) ? $aStatusColours[ $iDateStatus] : null; }printf("Colour is: %s", $szStatusColour);
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|