title: How do I group same array
body: <p>Example my array</p>
  
  <pre><code>Array (
   [0] =&gt; Array
       (
           [product_name] =&gt; T-Shirt
           [product_id] =&gt; 231
           [user_id] =&gt; 22977
       )
  
   [1] =&gt; Array
       (
           [product_name] =&gt; Shirt
           [product_id] =&gt; 220
           [user_id] =&gt; 22977
       )
  
   [2] =&gt; Array
       (
           [product_name] =&gt; T-Shirt
           [product_id] =&gt; 226
           [user_id] =&gt; 16916
       )
  
   [3] =&gt; Array
       (
           [product_name] =&gt; Bags
           [product_id] =&gt; 230
           [user_id] =&gt; 16916
       )
  
   [4] =&gt; Array
       (
           [product_name] =&gt; Hats
           [product_id] =&gt; 233
           [user_id] =&gt; 22977
       )
  </code></pre>
  
  <p>)</p>
  
  <p>How to generate this array to be</p>
  
  <pre><code>User-Id: 22977
  1/ Hats
  2/ Shirt
  3/ T-Shirt
  
  
  User-Id: 16916
  1/ Bags
  2/ T-Shirt
  </code></pre>