After I finished the 3 Pan Galactic Gargle Blasters, "Kjaer og
Monsson" <kjarmons@worldonline.dk> just offered me, he muttered some
weird stuff, and I had to correct this gibberish:
>hvordan får jeg den til at vise en tilfældig del af array'en?
>Undskyld men jeg er en extrem newbie.
tjaeh, du kan enten kigge på:
http://dk.php.net/manual/en/function.srand.php
http://dk.php.net/manual/en/function.rand.php
eller du kan bruge shuffle på array'et.
$array = array(1,2,3,4,5,6,7,8);
srand ((double)microtime()*1000000);
shuffle ($array);
print $array[0];
--
Martin Mouritzen. |
http://www.trendy.dk
The truth is out there! Does anyone know the URL?