Posted by Oli Filth on 03/29/06 14:14
Alkimake said the following on 29/03/2006 09:36:
> here the main problem begins. :)
>
> if i control every each $v then execution goes and goes forever.
> Actually i tried but i could not get combinations. Thanks for helping
> but if you can modify the code to do combinations i would really like
> to know. Thanks again.
I'll give you a clue (because I'm mean ;) ).
In getPermutations(), the next layer of recursion is being passed the
current array, bit with the current value of the foreach loop removed.
To make a getCombinations(), you'll need to pass only items to the right
of the current foreach value.
You can do this by altering two lines of code in the function I gave you...
--
Oli
Navigation:
[Reply to this message]
|