Ever wanted a random CSS? If so read on.
Using PHP it is very easy to have a random style sheet. Use the following code
- Code: Select all
<link rel="stylesheet" type="text/css" href="<?php
$stylesarray = array("red","blue","black");
echo $stylesarray[rand(1,3)];
?>.css">
Where it says red, blue and black, change it to your style sheets. If you have more than 3 eg 5 change [rand(1,3)]; to [rand(1,5)];
So when a user loads up a page, it could load black.css or red.css etc.
Thanks,
Greg




