2

Possible Duplicate:
Display possible combinations of string

In PHP, I need to get all different word combinations in a sentence.

For example : "The Quick Brown Fox" would produce:

The Quick Brown Fox
Quick Brown Fox The
Brown Fox Quick The
Brown Quick Fox
Quick Brown
Quick Fox
Brown Fox
Fox Quick
Brown The
The Fox
The Quick
The
Quick
Brown
Fox

etc. (of course there are some more).

I exploded all parts into an array, but now I'm a bit lost how to get all different combinations...

Community
  • 1
  • 1
Dylan
  • 9,129
  • 20
  • 96
  • 153
  • 2
    answer here: http://stackoverflow.com/questions/3200272/display-possible-combinations-of-string –  Aug 29 '11 at 23:41
  • 1
    [Permutations and Combinations](http://www.mathsisfun.com/combinatorics/combinations-permutations.html) are different.... I think what you are asking for are the permutations. – ace Aug 29 '11 at 23:45

0 Answers0