Organizational Research By

Surprising Reserch Topic

get all permutations of a php array


get all permutations of a php array  using -'php,permutation,combinatorics'

Given a PHP array of strings, e.g.:

['peter', 'paul', 'mary']


How to generate all possible permutations of elements of this array? i.e.:

peter-paul-mary
peter-mary-paul
paul-peter-mary
paul-mary-peter
mary-peter-paul
mary-paul-peter

    
asked Oct 19, 2015 by vimaldas2005
0 votes
1 view



Related Hot Questions



Government Jobs Opening


...