bouzin.php
Code :
<?php $nbimage=2; $nomimage[1]="pages/photos/abs/img1"; $nomimage[2]="pages/photos/anim/img2"; $affimage= rand(1, $nbimage); ?> <!-- plein de code html --> <img src="<?= $nomimage[$affimage];?>" alt="image aléatoire"> <!-- le reste du HTML -->
|
Et accessoirement, tu peux aussi créer ton tableau directement au lieu de te faire chier: genre:
Code :
$images = array("pages/photos/abs/img1", "pages/photos/anim/img2" );
|
Ca commence l'indexation à 0 btw, comme chez toute personne saine et respectable
Enfin, ton $nbimage est d'une inutilité grandiose, utilise donc count(), t'es pas en C ![[:pingouino] [:pingouino]](https://forum-images.hardware.fr/images/perso/pingouino.gif)
---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?