I have a set of 4 HTML list items and I'd like to shuffle the order they appear in once a week. I was wondering if anyone out there had a nice, elegant solution to this?
As always, I'd be enormously grateful for any input you might have!
UPDATE:
Unfortunately, even with the necessary .htaccess overrides, I just can't get any srand() based solutions to work on this particular server sadly, but have the following which could be used instead - at the moment, it only returns one list item - how could I modify it to show the four required? Once again, any ideas would be gratefully received :)
function RandomList($TimeBase, $QuotesArray){
$TimeBase = intval($TimeBase);
$ItemCount = count($QuotesArray);
$RandomIndexPos = ($TimeBase % $ItemCount);
return $QuotesArray[$RandomIndexPos];
}
$WeekOfTheYear = date('W');
$RandomItems = array(
"<li><a href=\"#northern-germany\" title=\"Northern Germany\">North</a></li>","<li><a href=\"#southern-germany\" title=\"Southern Germany\">South</a></li>","<li><a href=\"#western-germany\" title=\"Western Germany\">West</a></li>","<li><a href=\"#eastern-germany\" title=\"Eastern Germany\">East</a></li>");
print RandomList($WeekOfTheYear, $RandomItems);