note 31203 added to function.array-rand

From: Date: Sun, 13 Apr 2003 14:58:16 +0000
Subject: note 31203 added to function.array-rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-46569@lists.php.net to get a copy of this message
Note that the int num_req parameter is the required number of element to randomly select. So if your array has 3 element and num_req=4 then array_rand() will not return anything since it is impossible to select 4 random elements out of an array that only contains 3 elements. Many people think that they will get 3 elements returned but that is of course not the case. -- http://www.php.net/manual/en/function.array-rand.php http://master.php.net/manage/user-notes.php?action=edit+31203 http://master.php.net/manage/user-notes.php?action=delete+31203 http://master.php.net/manage/user-notes.php?action=reject+31203

« previous php.notes (#46569) next »