Das PHP Script Verzeichnis

Mit der PHP Funktion kann man tägliche, wöchentliche usw. Zufalls Quotes einblenden.

function RandomQuoteByInterval($TimeBase, $QuotesArray){

// Make sure it is a integer
$TimeBase = intval($TimeBase);

// How many items are in the array?
$ItemCount = count($QuotesArray);

// By using the modulus operator we get a pseudo
// random index position that is between zero and the
// maximal value (ItemCount)
$RandomIndexPos = ($TimeBase % $ItemCount);

// Now return the random array element
return $QuotesArray[$RandomIndexPos];
}[/php]

Quelle: jonasjohn.de