Math_Combinatorics provides the ability to find all combinations and permutations given an set and a subset size. Associative arrays are preserved.
array array_shift_assoc( array &$array, array $array)
array combinations( array $set, [int $subset_size = null])
array permutations( array $set, [int $subset_size = null])