note 23124 deleted from function.mt-rand by betz

From: Date: Mon, 18 Nov 2002 11:12:51 +0000
Subject: note 23124 deleted from function.mt-rand by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-39631@lists.php.net to get a copy of this message
Sorry, I'm beginer, can some body help me? I use PHP4 I need to generate a numerical row - a numbers from 1 to 100. But (for example, I take a row from 1 to 5): <?php $row[] = (mt_rand(1,5)); $row[] = (mt_rand(1,5)); $row[] = (mt_rand(1,5)); $row[] = (mt_rand(1,5)); $row[] = (mt_rand(1,5)); ?> - is unsatisfactory for me, becouse I need to have a numerical row, in which must be _all_ numbers (1,2,3,4,5 - in our example), _and_ each number must be unique. (In our example- 1,3,5,2,4 - is good; _1_,3,_1_,5,2 - is bad). How to do this?

« previous php.notes (#39631) next »