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 combinations( $set, [int $subset_size = null])
array permutations( $set, [int $subset_size = null])