Math_Combinatorics provides the ability to find all combinations and permutations given an set and a subset size. Associative arrays are preserved.
PHP version 5