note 66785 added to function.mt-rand
| From: | arias at elleondeoro dot com | Date: | Mon, 29 May 2006 09:03:57 +0000 |
| Subject: | note 66785 added to function.mt-rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-112485@lists.php.net to get a copy of this message | ||
Be carefull with: $characters[mt_rand(0, count($characters))];
"If you want a random number between 5 and 15 (inclusive), for example, use mt_rand (5,
15)."
Array index are between 0 and n-1, but mt_rand generates a number between 0 and n!
----
Server IP: 130.206.1.5
Probable Submitter: 81.9.164.112
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.mt-rand.php
Edit -- http://master.php.net/note/edit/66785
Del: integrated -- http://master.php.net/note/delete/66785/integrated
Del: useless -- http://master.php.net/note/delete/66785/useless
Del: bad code -- http://master.php.net/note/delete/66785/bad+code
Del: spam -- http://master.php.net/note/delete/66785/spam
Del: non-english -- http://master.php.net/note/delete/66785/non-english
Del: in docs -- http://master.php.net/note/delete/66785/in+docs
Del: other reasons-- http://master.php.net/note/delete/66785
Reject -- http://master.php.net/note/reject/66785
Search -- http://master.php.net/manage/user-notes.php