Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to group multidimension array by key with php?
    text
    copied!<p>I have this array:</p> <pre><code>Array ( [0] =&gt; Array ( [0] =&gt; 78 [mount] =&gt; 78 [1] =&gt; activation [type] =&gt; activation [2] =&gt; 2013-10-01 [insertdate] =&gt; 2013-10-01 ) [1] =&gt; Array ( [0] =&gt; 130 [mount] =&gt; 130 [1] =&gt; activation [type] =&gt; activation [2] =&gt; 2013-10-02 [insertdate] =&gt; 2013-10-02 ) [2] =&gt; Array ( [0] =&gt; 210 [mount] =&gt; 210 [1] =&gt; activation [type] =&gt; activation [2] =&gt; 2013-10-03 [insertdate] =&gt; 2013-10-03 ) [3] =&gt; Array ( [0] =&gt; 190 [mount] =&gt; 190 [1] =&gt; activation [type] =&gt; activation [2] =&gt; 2013-10-04 [insertdate] =&gt; 2013-10-04 ) [4] =&gt; Array ( [0] =&gt; 250 [mount] =&gt; 250 [1] =&gt; activation [type] =&gt; activation [2] =&gt; 2013-10-05 [insertdate] =&gt; 2013-10-05 ) [5] =&gt; Array ( [0] =&gt; 300 [mount] =&gt; 300 [1] =&gt; activation [type] =&gt; activation [2] =&gt; 2013-10-06 [insertdate] =&gt; 2013-10-06 ) [6] =&gt; Array ( [0] =&gt; 330 [mount] =&gt; 330 [1] =&gt; activation [type] =&gt; activation [2] =&gt; 2013-10-07 [insertdate] =&gt; 2013-10-07 ) [7] =&gt; Array ( [0] =&gt; 100 [mount] =&gt; 100 [1] =&gt; revenue [type] =&gt; revenue [2] =&gt; 2013-10-01 [insertdate] =&gt; 2013-10-01 ) [8] =&gt; Array ( [0] =&gt; 310 [mount] =&gt; 310 [1] =&gt; revenue [type] =&gt; revenue [2] =&gt; 2013-10-02 [insertdate] =&gt; 2013-10-02 ) [9] =&gt; Array ( [0] =&gt; 200 [mount] =&gt; 200 [1] =&gt; revenue [type] =&gt; revenue [2] =&gt; 2013-10-03 [insertdate] =&gt; 2013-10-03 ) [10] =&gt; Array ( [0] =&gt; 400 [mount] =&gt; 400 [1] =&gt; revenue [type] =&gt; revenue [2] =&gt; 2013-10-04 [insertdate] =&gt; 2013-10-04 ) [11] =&gt; Array ( [0] =&gt; 470 [mount] =&gt; 470 [1] =&gt; revenue [type] =&gt; revenue [2] =&gt; 2013-10-05 [insertdate] =&gt; 2013-10-05 ) [12] =&gt; Array ( [0] =&gt; 310 [mount] =&gt; 310 [1] =&gt; revenue [type] =&gt; revenue [2] =&gt; 2013-10-06 [insertdate] =&gt; 2013-10-06 ) [13] =&gt; Array ( [0] =&gt; 600 [mount] =&gt; 600 [1] =&gt; revenue [type] =&gt; revenue [2] =&gt; 2013-10-07 [insertdate] =&gt; 2013-10-07 ) ) </code></pre> <p>The goal is to convert it to 1 dimension array which result as:</p> <pre><code>array([type]=&gt;activation [mount]=&gt;78,130,210,190,250,300,330), array([type]=&gt;revenue [mount]=&gt;100,310,200,400,470,310,600) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload