I have an array ['cat','dog','rabbit','snake','sheep','cow','horse','pig'] and I want to output every combination of the elements, while also removing elements until the the data set includes one of each animal.
['cat','dog','rabbit']
['cat','dog',]
['cat']
['dog','rabbit']
['dog']
['cat','rabbit']
['rabbit']
but with a lot more data etc...
Are there any modules to help with this?
Thanls