|  | Posted by Geoff Berrow on 06/14/05 13:22 
I noticed that Message-ID: <av4ta1h08up98hikop6q8jldgsihobqkpn@4ax.com>from Ewoud Dronkert contained the following:
 
 >On Mon, 13 Jun 2005 23:54:08 +0100, Geoff Berrow wrote:
 >> for($i=1;$i<50;$i++){
 >> 	$balls[]=$i;
 >> }
 >
 >See http://php.net/range
 
 Code is from a course I run and it's a good idea to get the students
 used to using loops
 >
 >> for($i=0;$i<6;$i++){
 >> 	$key=array_rand($balls);
 >> 	$ballschosen[]=$balls[$key];
 >> 	unset($balls[$key]);
 >> }
 >
 >See http://php.net/shuffle
 
 For some reason I've never been able to get shuffle to work properly.
 >
 >> asort($ballschosen);
 >
 >Why use asort when you don't use the keys? See http://php.net/asort
 
 Seemed like a good idea at the time :)
 --
 Geoff Berrow (put thecat out to email)
 It's only Usenet, no one dies.
 My opinions, not the committee's, mine.
 Simple RFDs http://www.ckdog.co.uk/rfdmaker/
  Navigation: [Reply to this message] |