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
2 views



Related Hot Questions

3 Answers

0 votes
NULL
answered Oct 19, 2015 by devkumargupta
0 votes
NULL
answered Oct 19, 2015 by balvant maurya
0 votes
NULL
answered Oct 19, 2015 by yogeshplv

...