Autor Zpráva
tonda
Profil *
Mám script PHP-
-------------
$images = array( "../image/baner1.gif", "../image/baner2.gif" );
mt_srand(time());
$random_index = mt_rand(1, (count($images)));
$random_index--;
------------------
Chtěl bych aby se obrázky střídali po 12 hodinách.
Děkuji.
kureal
Profil
Co třeba toto:
$images = array("../image/baner1.gif", "../image/baner2.gif");
$changeInterval = 12*60*60; //perioda zmeny obrazku v sekundach
$random_index = hexdec(substr(md5(floor(time()/$changeInterval)), 0, 6))%count($images);
$imagesPath = $images[$random_index];
tonda
Profil *
kureal-Zkopíroval jsem a není funkční.Můj editor se nějak špatně dívá na -%count-.Jinak děkuji za snahu.

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0