1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| <?php
$homeurl = "http://www.top-favoris.co.cc/";
$imgurl = "http://i64.servimg.com/u/f64/11/94/21/24/";
$img = array(
0 => array("fifa10.gif", "sport/fifa.html"),
1 => array("uefa10.jpg", "sport/uefa.html"),
2 => array("cafonl10.gif", "sport/cafonline.html"),
3 => array("afc10.gif", "sport/the-afc.html"),
4 => array("concac10.gif", "sport/concacaf.html"),
5 => array("livesc10.jpg", "sport/livescore.html")
);
// avec doublons possibles
$nbImages = count($img);
for ($i=0; $i<$nbImages; $i++){
$imgChoisie = $img[rand(0, $nbImages-1)];
printf('<a href="%s"><img src="%s"/></a>', $homeurl.$imgChoisie[1], $imgurl.$imgChoisie[0]);
}
// sans doublons
$imgTmp = $img;
do{
$nbImages = count($imgTmp);
$indice = rand(0, $nbImages-1);
printf('<a href="%s"><img src="%s"/></a>', $homeurl.$imgTmp[$indice][1], $imgurl.$imgTmp[$indice][0]);
unset($nbImages[$indice])
} while ($nbImages);
?> |
Partager