convert existing array to a new one?
<p>In my manipulate I got an array contain data like this:</p>

<pre><code> $A = Array
    (
        [0] =&gt; 0302 sa
           [1] =&gt; 0602 sdsa
           [2] =&gt; 0602 sada
           [3] =&gt; 0802 sadasdasd
        [4] =&gt; 0302 sada
           [5] =&gt; 0602 saa
           [6] =&gt; 0602 sdad
           [7] =&gt; 0802 sds
        [8] =&gt; 0302 sda
           [9] =&gt; 0602 sdada
           [10] =&gt; 0602 sada
           [11] =&gt; 0802 sdada
        [12] =&gt; 0302 sda
           [13] =&gt; 0602 sdads
           [14] =&gt; 0602 saddas
           [15] =&gt; 0802 sadas
    )
</code></pre>

<p>the output will be the new array</p>

<pre><code> $B = Array
        (//03
        [0] =&gt; array( 
                    [0] =&gt; 0602 sdsa,//06
                    [1] =&gt; 0602 sada //06
        )
        //03
        [1] =&gt; array(
                 [0] =&gt; 0602 saa,//06
                 [1] =&gt; 0602 sdad //06
               )
                //03
        [2] =&gt; array(
                 [0] =&gt; 0602 sdada,//06
                 [1] =&gt; 0602 sada //06
          )
          //03
        [3] =&gt;array(
                 [0] =&gt; 0602 sdads,//06
                 [1] =&gt; 0602 saddas//06
        )
    )
</code></pre>

<p>Try</p>

<pre><code>function TODO($A){
  $B = array();
  foreach ($A as $key=&gt;$line){
 if(substr($line,0,2)=="03"){
     $B[] = ???
   }
}
</code></pre>

<p>Who can help me to solve this?</p>
