Getting All combinations from an array PHP
<p>I just need your help. I'm building a system using PHP about academic advising. basically I need an algorithm on how to implement the main function of the system. The main idea is that there are a list of courses in an array and I need to get all the possible combinations from that list. Each courses would have a unit/number that specifies its size. The algo should make combinations base on a certain size.</p>

<p>For example.</p>

<pre><code>English - 1
Math - 3
Algebra - 3
History 3
Computer(lec) - 2
Computer(lab) - 1
</code></pre>

<p>Maximum Size = 9.</p>

<p>So the algo should get all the combinations without exceeding the size limit.</p>

<p>so the result could be like this.</p>

<pre><code>(Math , Algebra , History ) the size is equal to 9
(History , Computer(lec), Computer(lab), Algebra)
(English , Computer(lec), Computer(lab), Algebra)
</code></pre>

<p>Something like that. Thanks. I just need your advice.</p>
