Incrémentation aléatoire

Utilisateur anonyme - 18 févr. 2006 à 20:04
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 - 18 févr. 2006 à 23:56
Salut les gens ;)

Voila, donc j'ai un chiffre : time() :p

Et je voudrais commencer à time() et l'incrémenter aléatoirement avec rand() mais je ne sais pas comment l'on fait, je dois le faire beaucoup de fois donc je ne vais m'amuser à le faire à la main :p

Merci à vous ;)

1 réponse

cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
18 févr. 2006 à 23:56
Salut,

l'incrémenter ?

heu $chiffre=time();

et tant que tu veux incrémenter :

while(condition)
{
$chiffre+=mt_rand(blabla); //http://fr.php.net/manual/fr/function.mt-rand.php
}

<hr size="2" width="100%"><li>Entraide, dépannage et vulgarisation informatique : Mon site de vulgarisation informatique</li><li>Codes-php.net</li>
0
Rejoignez-nous