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...