Werbung
Werbung
Werbung
Archive
Folge uns auf Twitter
Werbung

Jede Menge neue Twitter Follower bekommen. Die Software hat einen kostenlosen Trial Mode, der bis zu 250 Follower bringt.

Willkommen
Willkommen im PHP Archiv Blog! Hier gibts Infos zum Thema PHP Codeschnipsel und Tipps. Bei unserem Projekt phparchiv.de, finden Sie über 5700 Scripte.

Täglich wechselnde Random Quotes

Diese Funktion zeigt täglich wechselnden Zufallstext an.

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];
}

/*
** --> See the example section below for a
** detailed instruction.
*/
[/php]
Quelle: Jonas John

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

*

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>