note 112316 deleted from function.rand by danbrown
| From: | danbrown@php.net | Date: | Wed, 05 Jun 2013 17:39:40 +0000 |
| Subject: | note 112316 deleted from function.rand by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-195061@lists.php.net to get a copy of this message | ||
Note Submitter: Brian
----
This function returns random boolean.
function randomBoolean() {
return rand(0, 1) == 1;
}
According to the manual mt_rand function uses better random number generator.
function randomBoolean2() {
return mt_rand(0, 1) == 1;
}