I want to do permutation of 10 elements (values) array in PHP. I tried to modify bubble sort algorithm, but I think it's doesn't efficient way to do that. All of permutations should be 10!. Thank you in advance for any help.
For exmaple:
{0,1,3...}
{0,3,1...}
{1,0,3...}
{1,3,0...}
{3,1,0...}
{3,0,1...}