| Posted by Geoff Berrow on 06/14/05 01:54 
I noticed that Message-ID:<1118689179.0bfe721d1be71944ad69de19a67d3613@teranews> from Mark
 contained the following:
 
 >The problem is that there is nothing to stop images appearing more than
 >once. I do not want this to happen...
 >
 >Any ideas on a possible solution?
 
 The following picks lottery balls (6 unique balls out of 49)  Trivial to
 adapt it to what you want.
 
 <html>
 <body style="color:red"><?php
 
 for($i=1;$i<50;$i++){
 $balls[]=$i;
 }
 
 for($i=0;$i<6;$i++){
 $key=array_rand($balls);
 $ballschosen[]=$balls[$key];
 unset($balls[$key]);
 }
 
 asort($ballschosen);
 
 foreach($ballschosen as $choice){
 print"$choice  ";
 }
 
 ?>
 </body>
 </html>
 
 --
 Geoff Berrow  0110001001101100010000000110
 001101101011011001000110111101100111001011
 100110001101101111001011100111010101101011
  Navigation: [Reply to this message] |