On May 29, 2012, at 11:41 AM, Adam Richardson wrote: > On Tue, May 29, 2012 at 10:55 AM, Tedd Sperling <tedd@xxxxxxxxxxxx> wrote: >> On 29 May 2012 18:15, Gary <listgj-phpgeneral@xxxxxxxxxxx> wrote: >> >>> Okay, let's assume I have three "things", A, B, and C. I need to produce >>> an array with a list of all possible combinations of them, however many >>> there might be in those combinations: e.g. A, B, C, D, AB, AC, AD, BC, >>> ABC (not sure if I've missed any!). Normally I'm pretty good at working >>> this stuff out, but to be honest I'm struggling with this one, at least >>> to do it in any kind of elegant way. Does anyone have any ideas? >> >> Sure, but what you are asking for is a permutation and not a combination. > > His example seems to suggest order does not matter (I've omitted 'D', > which I suspect was a typo given the set of A, B, and C): Ahhh yes, he said AB, AC, BC, and ABC, but not AB, BA, AC, CA, and so on. I stand corrected. Cheers, tedd _____________________ tedd@xxxxxxxxxxxx http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php