title: How to add multiple array elements into a transposed structure?
body: <p>I have these arrays</p>
  <pre class="lang-php prettyprint-override"><code>$months = ['jan', 'feb'];
  
  $cashUniform = [2000, 1200];
  
  $cashFee = [24000, 34000];
  
  $cashExpenses = [4000, 300];
  </code></pre>
  <p>Am trying to create an object from these arrays like so:</p>
  <pre><code>$data = [{
   'month': 'jan',
   'cashUniform': 2000,
   'cashFee': 24000,
   'cashExpenses': 4000,
  },
  {
   'month': 'feb',
   'cashUniform': 12000,
   'cashFee': 34000,
   'cashExpenses': 300,
   }
  ];
      
  </code></pre>
  <p>I've tried array_combine but it only accepts two array elements, and in my case, I have four array elements.</p>
  <p>I've also tried to to create a multiple array.</p>
  <pre><code>  $data['months'] = $months;
    $data['cashFee'] = $cashFee;
    $data['cashUniform'] = $cashUniform;
    $data['cashExpenses'] = $cashExpenses;
    dd(json_encode($data));
  </code></pre>
  <p>The code above returns</p>
  <pre><code>{&quot;months&quot;:[&quot;JAN&quot;,&quot;FEB&quot;],&quot;cashFee&quot;:   [12500,2000],&quot;cashUniform&quot;:[2000,0],&quot;cashExpenses&quot;:[1500,0]}
  </code></pre>