}
}
else
{
$retval[] = implode($glue, $a);
}
}
-Original Message-
From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 12:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Generate every possible combination
I need to generate ev
o:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 2:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Generate every possible combination
I need to generate every possible combination of the the values in an array.
For example, if...
$array = Array("A", "B", "C");
I want
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"
[1] => "ACB"
[2] => "BAC"
3 matches
Mail list logo