Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder student's Avatar
    Join Date
    Jan 2007
    Posts
    129
    Thanks
    13
    Thanked 0 Times in 0 Posts

    how to shuffle elements in an array?

    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

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    shuffle()

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

  • #3
    Regular Coder student's Avatar
    Join Date
    Jan 2007
    Posts
    129
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Thanks fumigator,
    From now, I will first search the manual before posting here.
    thanks for your quick reply


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •