Eventually we may need to get all possible combinations between some elements. For example let’s say we have 3 elements. A, B and C. Now we want to get all the possible combinations of these elements making groups of two. The result is 3 combinations: It looks very straightforward, however a function like this doesn’t exist in PHP. So you …