note 96671 added to function.mt-rand
| From: | EhsanChavoshi at osu1 dot php dot net | Date: | Wed, 10 Mar 2010 19:25:54 +0000 |
| Subject: | note 96671 added to function.mt-rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-166884@lists.php.net to get a copy of this message | ||
to generate multiply unique random numbers , i wrote this function using mt_randf function
[http://www.php.net/manual/en/function.lcg-value.php#96032]
function multirand($min,$max,$count) {
$total = $max - $min;
$inc = $total / $count;
for ($i=0 ;$i<$count;$i++)
$numbers[] = $min+round(($i*$inc)+mt_randf(1,$inc));
return $numbers;
}
----
Server IP: 69.147.83.197
Probable Submitter: 67.205.102.45
----
Manual Page -- http://www.php.net/manual/en/function.mt-rand.php
Edit -- https://master.php.net/note/edit/96671
Del: integrated -- https://master.php.net/note/delete/96671/integrated
Del: useless -- https://master.php.net/note/delete/96671/useless
Del: bad code -- https://master.php.net/note/delete/96671/bad+code
Del: spam -- https://master.php.net/note/delete/96671/spam
Del: non-english -- https://master.php.net/note/delete/96671/non-english
Del: in docs -- https://master.php.net/note/delete/96671/in+docs
Del: other reasons-- https://master.php.net/note/delete/96671
Reject -- https://master.php.net/note/reject/96671
Search -- https://master.php.net/manage/user-notes.php