This question already has an answer here:
- How to get random value out of an array 12 answers
Hello i just have created file with array :
$imiona[0] = "wilk";
$imiona[1] = "wilk";
$imiona[2] = "abyss ";
$imiona[3] = "IDiO";
$imiona[4] = "zdumiona";
$imiona[5] = "skorpion";
$imiona[6] = "abaddon";
$imiona[7] = "noell";
$imiona[8] = "eXocet";
$imiona[9] = "NieIronik";
$imiona[10] = "El Chupacabra";
Now i just want display only 5 random results how to do this? i try with this:
foreach ($imiona as $imiona) {
echo rand($imiona);
}
Aucun commentaire:
Enregistrer un commentaire