...

View Full Version : how to shuffle elements in an array?



student
03-30-2007, 05:51 AM
Hello,
I have a small doubt.
I have some 20 elements in an array.
I would like to shuffle them and display them.

for example:
$array=array('a', 'b', 'c', ....'r', 's');

I would like to shuffle and display the elements like this.
c, m, a,....e, n

I dont wish to repeat any element.
how can I do it?
Thank you

Fumigator
03-30-2007, 05:56 AM
shuffle() (http://us.php.net/manual/en/function.shuffle.php)

You really should learn to search the manual-- it's an excellent reference.

student
03-30-2007, 06:26 AM
Thanks fumigator,
From now, I will first search the manual before posting here.
thanks for your quick reply



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum