Unique Array
| From: | Deirdre Mc Cann | Date: | Mon, 10 Sep 2001 11:29:43 +0000 |
| Subject: | Unique Array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-66726@lists.php.net to get a copy of this message | ||
Hi
Can anyone help me? I need to produce a random and uniques array using numbersbetween 0 and 9. I tried to create a random array and them make it unique.
for ($i = 0; $i<100; $i++){
$a[$i] = rand(0,9);
$test=$a[$i];
}
$ra = array_unique($test);
I keep getting an error saying $test is the incorrect type. Can someone please explain why this doesn't work. And does anyone know how to get a unique and random array, every time the page is refreshed.
Thanks
Deirdre
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp