note 11121 deleted from function.srand by cece

From: Date: Tue, 30 Mar 2004 14:16:20 +0000
Subject: note 11121 deleted from function.srand by cece
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-67383@lists.php.net to get a copy of this message
Note Submitter: info@tool-pi.de ---- hallo, now i didn´t have a problem. my problem was to choice a number but the number don´t double before others. you now? i take it so: my formular have a hidden formtag the value = 45;23;1;6;7;8 now my script dont find a number that will be in formvalue. i just like write this routine. $FORM_NUMBERS="45;23;1;6;7;8"; $MY_NUMBERS=explode(";",$FORM_NUMBERS); $COUNTER=count($MY_NUMBERS); /* Look arround my Number and take a new*/ for($I=0;$I<$COUNTER;$I++){ mt_srand((double)microtime()*1000000); $NUMBER = mt_rand(0,$ROWS-1); if(!preg_match("/".$NUMBER."/",$Z)){ echo "Ahhh -> here is my new number"; $FORM_NUMBERS.";".$NUMBER break; } else{ $COUNTER++; } } $ROWS is result of mysql select now you can see what number is double! ciao from germany Toolpi

« previous php.notes (#67383) next »