[PHP] Re: Randomize an array?

2005-03-07 Thread M. Sokolewicz
Brian Dunning wrote: I have a Magpie RSS feed in an array, and I want to output it in random order. What's the best (fastest) way to do this? - Brian easiest: array_rand() http://www.php.net/array_rand -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re: Randomize an array?

2005-03-07 Thread Brian Dunning
On Mar 7, 2005, at 7:40 AM, M. Sokolewicz wrote: array_rand() But that's likely to give me the same element more than once. I want to output the entire array but in a random order, like a shuffled deck of cards. - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Re: Randomize an array?

2005-03-07 Thread Jay Blanchard
[snip] array_rand() But that's likely to give me the same element more than once. I want to output the entire array but in a random order, like a shuffled deck of cards. [/snip] Wow,. http://www.php.net/shuffle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re: Randomize an array?

2005-03-07 Thread Rick Fletcher
Brian Dunning wrote: On Mar 7, 2005, at 7:40 AM, M. Sokolewicz wrote: array_rand() But that's likely to give me the same element more than once. I want to output the entire array but in a random order, like a shuffled deck of cards. like a shuffled deck of cards? http://www.php.net/shuffle --

Re: [PHP] Re: Randomize an array?

2005-03-07 Thread Brian Dunning
http://www.php.net/shuffle Boy do I feel stupid. Thanks!! :) I always RTFM and STFW before posting - but somehow did not search the PHP site for the word shuffle. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: randomize etc?

2002-08-01 Thread Philip Hallstrom
split should work fine... Just do something like: $teamMembersArray = split( ,;, $textarea); That will give you an array of the team members. Of course I'm assuming that their names don't include spaces and that you'll separate them with either a space, comma, or semi-colon. And you'll want

[PHP] Re: randomize?

2002-05-10 Thread George Nicolae
yes. you can. ;) -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com Hawk [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a group table with 16 items, and I want them to be randomly

[PHP] Re: randomize?

2002-05-10 Thread Hawk
oh, thank you very much :P George Nicolae [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... yes. you can. ;) -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com Hawk [EMAIL

Re: [PHP] Re: randomize?

2002-05-10 Thread Dan Hardiker
[..] is there any way to limit to 4 in each group without 47839 rows of code? [..] yes. you can. ;) [..] oh, thank you very much :P [..] This might be a bit more helpful ;) There are several way to do it, this is just one. Unoptimised, aimed at readability. ?php // Split $items equally