title: having trouble in transforming a array in php
body: <p>i have this array </p>
  
  <pre><code>[ 
      [[222] =&gt; 1 [333] =&gt; 2 [444] =&gt; 0],
      [[222] =&gt; 0 [333] =&gt; 2 [444] =&gt; 1],
      [[222] =&gt; 1 [333] =&gt; 2 [444] =&gt; 0]
  ]
  </code></pre>
  
  <p>where [222], [333], [444] are student ids<br>
  and 0 means absent
      1 means Present
      2 means Leave</p>
  
  <p>i want the output will </p>
  
  <pre><code>[ 'student_id' =&gt; '222'
    'present' =&gt; 2 /* total present*/
    'absent' =&gt; 1  /* total absent*/
    'leave'  =&gt; 0 /* total leave*/
  ],
  [ 'student_id' =&gt; '333'
    'present' =&gt; 0 /* total present*/
    'absent' =&gt; 0  /* total absent*/
    'leave'  =&gt; 3 /* total leave*/
  ],
  </code></pre>
  
  <p>etc.</p>
  
  <p>please give me some soluation in php code</p>