note 29124 added to function.rand
| From: | nyora at gaagle dot com | Date: | Mon, 03 Feb 2003 23:04:35 +0000 |
| Subject: | note 29124 added to function.rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43343@lists.php.net to get a copy of this message | ||
-----
On 16-Jul-2002 at 05:27, noisehnois@sigilodoemail.org.net wrote:
-----
$firsts = rand(0,999);
$seconds = rand(0,999);
$thirds = rand(0,999);
$fourths = rand(0,999);
$total = $firsts.$seconds.$thirds.$fourths;
echo $total;
-----
$firsts = rand(0,9);
$seconds = rand(0,9);
$thirds = rand(0,9);
$fourths = rand(0,9);
...
$total = $firsts.$seconds.$thirds.$fourths...etc.;
how about that one? if you have to generate a random number of a 'certain length'..
--
http://www.php.net/manual/en/function.rand.php
http://master.php.net/manage/user-notes.php?action=edit+29124
http://master.php.net/manage/user-notes.php?action=delete+29124
http://master.php.net/manage/user-notes.php?action=reject+29124