Let's say I have the letters...
A,D, and G
And O (It's special)
How can PHP make all possible combinations with these words by using all or as little amount of letters as possible? (But special letters must be included in each scramble)
For example PHP would go through those letters and get...
A-O
O-A
O-D-G
D-O-G
G-D-O
D-G-O
A-D-G-O
And on and on and on...
What would be the fastest way to do this and if it is a function return those in an array?