1, 2 and 3 combinations
Posted: Thu Jul 29, 2010 7:46 pm
If i had this string to show how many numbers there were:
$numbers = 3;
This would mean that I have the numbers 1,2,3.
How would I put them into this order and combination:
I want the shortest combinations first and the lowest number first when possible.
I do not want combinations with two of the same number.
I also need the points between numbers as i later will explode it into an array.
1
2
3
1.2
1.3
2.1
2.3
3.1
3.2
1.2.3
1.3.2
2.1.3
2.3.1
3.1.2
3.2.1
Thank you for you help!
$numbers = 3;
This would mean that I have the numbers 1,2,3.
How would I put them into this order and combination:
I want the shortest combinations first and the lowest number first when possible.
I do not want combinations with two of the same number.
I also need the points between numbers as i later will explode it into an array.
1
2
3
1.2
1.3
2.1
2.3
3.1
3.2
1.2.3
1.3.2
2.1.3
2.3.1
3.1.2
3.2.1
Thank you for you help!