title: Get all possible combinations without duplicates
body: <p>How can I get all the possible combinations of given numbers.
  For instance I have <br></p>
  
  <p><code>$arr = [ 1, 2, 3, 4]</code></p>
  
  <p>I want to get the combinations without any duplicates inside the combinations</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>[1] =&gt; [1]
  [2] =&gt; [2]
  [3] =&gt; [3]
  [4] =&gt; [4]
  [5] =&gt; [1, 2]
  [6] =&gt; [1, 3]
  [7] =&gt; [1, 4]
  [8] =&gt; [2, 3]
  [9] =&gt; [2, 4]
  [10] =&gt; [3, 4]
  [11] =&gt; [1, 2, 3]
  [12] =&gt; [1, 2, 4]
  [13] =&gt; [1, 3, 4]
  [14] =&gt; [2, 3, 4]
  [15] =&gt; [1, 2, 3, 4]</code></pre>
  </div>
  </div>
  </p>