Dear members,
I want to loop the randomly generated numbers and then want to compare these numbers to find if any repeation occurs.Want this through loop.Loop that i am creating is just printing the same random number and not printing the different random numbers.Please correct the following code to :
1)get printed the randomly generated numbers, (say from 1 an 50)
2)loop these randomly generated numbers and display it
3)Comapre these 50 randomly generated numbers and if any repetation occurs,print any message to know which number is repeated.
Please ammend the following script to get the print of 50 randomly generated numbers and then comparing those to find out any repetition and showing the message on repetiotion
$var=0;
$count=50;
$at=rand(1,9);
$ha=rand(1,9);
$ch1 = rand(65,90);
$ch2 = rand(65,90);
srand((double)microtime()*1000000);
$v=at;
$ser= $at.$ha.chr($ch1).chr($ch2);
while($var<$count) {
echo $serial;
echo " ";
$var++;
}
Thanks for your time.