note 24672 added to function.mt-rand

From: Date: Sun, 25 Aug 2002 04:49:20 +0000
Subject: note 24672 added to function.mt-rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-35568@lists.php.net to get a copy of this message
in response to All-yvg@ukr.net on 10-Jul-2002 06:17: $i=0; while ($i<10) { $arr[$i]=$i; $i++; } srand ((float)microtime()*1000000); shuffle ($aFilenames); while (count($arr)>0) { echo array_shift($arr) } this "randomizes" the elements in the array then pulls off and prints out each array value -- essentially listing every item in the array only once. -- http://www.php.net/manual/en/function.mt-rand.php http://master.php.net/manage/user-notes.php?action=edit+24672 http://master.php.net/manage/user-notes.php?action=delete+24672 http://master.php.net/manage/user-notes.php?action=reject+24672

« previous php.notes (#35568) next »