DavidB3ck

07-16-2012, 10:54 PM

Hi. I'm new here and such. It's been a few years since I've been on any coding forums, but this one seems to be the most active from the forums I remember.

Anyway, I know this has been discussed many times before, but what I'm trying to do is a little different, and I have yet to find or come up with any satisfactory solutions. Basically, given the array, $arr = array(0, 1, 2, 3, 4);, I want to produce the following results:

01234

0123

0124

0134

0234

1234

012

013

014

023

024

034

123

124

134

234

01

02

03

04

12

13

14

23

24

34

0

1

2

3

4

The order of the elements in the array are from most to least important. In other words, the order of the results are from most to least important, or most to least similar to the original array.

Right now I can't even think of how to get started, so any help would be greatly appreciated.

Thanks!

Anyway, I know this has been discussed many times before, but what I'm trying to do is a little different, and I have yet to find or come up with any satisfactory solutions. Basically, given the array, $arr = array(0, 1, 2, 3, 4);, I want to produce the following results:

01234

0123

0124

0134

0234

1234

012

013

014

023

024

034

123

124

134

234

01

02

03

04

12

13

14

23

24

34

0

1

2

3

4

The order of the elements in the array are from most to least important. In other words, the order of the results are from most to least important, or most to least similar to the original array.

Right now I can't even think of how to get started, so any help would be greatly appreciated.

Thanks!