0

I have been trying to write a function in php that will output all possible outcome. Unfortunately I keep hitting a brick wall. So I was hoping someone could help me. Here is what I am trying to get there are 3 items with 3 possible outcomes. So there would be

(A <-> B) with x,y,z possible outcome

(C <-> D) with x,y,z possible outcome

(E <-> F) with x,y,z possible outcome

I am trying to write a script that will give me all the possible outcomes for all of them without repeating such that I would get

(A <-> B) (C <-> D) (C <-> D)

`x           x          x`
`y           x          x`
`z           x          x`
`y           y          y`
`z           y          y`
`z           y          y`
`z           z          z`

and so on for each item ...

any help would be appreciated

Thank you

Mike Y
  • 1
  • What output you need? – Anubhav Jan 14 '14 at 08:31
  • just need the outputs like in the example, I hope I am making sense. Basically all all possible combinations xyz – Mike Y Jan 14 '14 at 08:39
  • What is A, B, C and D why combine only XYZ – Anubhav Jan 14 '14 at 08:47
  • I am just using the letters as an example, i think I might have found what I am looking for [link](http://stackoverflow.com/questions/8506677/2-independent-events-3-times-enumerate-the-possible-outcomes?rq=1) – Mike Y Jan 14 '14 at 08:49
  • Check this out: http://stackoverflow.com/questions/14022215/php-how-do-you-generate-all-possible-combinations-of-values-in-an-array – Samuil Banti Jan 14 '14 at 09:01

0 Answers0