Mega Code Archive

 
Categories / Php / Code Snippets
 

This example will display a different background color for each day of the week

<html> <head> <title>Document</title> </head> <?php $today = date("w"); $bgcolor = array( "red", "blue", "green", "yellow", "purple", "brown", "orange" ); ?> <body bgcolor="<?print("$bgcolor[$today]");?>"> </body> </html>