Suppose we have six constants: 1 through 6.

I would like to have a formula to get all combinations of of them,

I give an example of what I mean:

1 and 2 and 3 and 4 and 5 and 6

1 and 2 and 3 and 4 and 5, but not 6

1 and 2 and 3 and 4, but not 5 and 6

...

2 and 3 and 4 and 5 and 6, but not 1

3 and 4 and 5 and 6, but not 1 and 2

...

1 and 3 and 4 and 5 and 6, but not 2

1 and 4 and 5 and 6, but not 2 and 3

...

...

I Think you've got it.

Lastly, I'd put this in a php script to get the correct combination

if(1 and 2 and 3 and 4 and 5 and 6) { do this }

if(1 and 2 and 3 and 4 and 5) { do that }

For me this is far over my training. Could you please lead me thorugh this.

Thanks.

if(1 and 2 and 3 and 4 and 5) covers both if(1 and 2 and 3 and 4 and 5 and 6) and if(1 and 2 and 3 and 4 and 5 and not 6)

so there would still be no need for more than of 2^6 separate if statements.

Which is still a large enough number that you'd probably prefer to use a table rather than individual if statements.