[PHP] Re: Generate every possible combination

2002-05-16 Thread Martin Wickman
Evan Nemerson wrote: > I need to generate every possible combination of the the values in an array. > For example, if... > > $array = Array("A", "B", "C"); > I really have no idea where to begin. The best lead I can think of is that > there are going to be n! elements in the output array, where

[PHP] Re: Generate every possible combination

2002-05-15 Thread Austin Marshall
Austin Marshall wrote: > Evan Nemerson wrote: > >> I need to generate every possible combination of the the values in an >> array. For example, if... >> >> $array = Array("A", "B", "C"); >> >> I want to be able to do something like >> >> print_r(magic_function($array)); >> >> which would output

[PHP] Re: Generate every possible combination

2002-05-15 Thread Austin Marshall
Evan Nemerson wrote: > I need to generate every possible combination of the the values in an array. > For example, if... > > $array = Array("A", "B", "C"); > > I want to be able to do something like > > print_r(magic_function($array)); > > which would output > > Array > ( > [0] => "ABC