title: from one-dimensional to two-dimensional array
body: <p>I have this PHP one dimensional array: </p>
  
  <pre><code>  Array
      (
          [Female--N] =&gt; 11
          [Male--N] =&gt; 11
          [Humans--N] =&gt; 11
          [Adult--N] =&gt; 8
          [Adolescent--N] =&gt; 8
          [Reaction Time-physiology--N] =&gt; 6
          [Acoustic Stimulation-methods--N] =&gt; 6
          [Schizophrenia-genetics--Y] =&gt; 5
          [Motion Perception--N] =&gt; 3
      )
  </code></pre>
  
  <p>And i want a new array from this that looks like (i think this tow-dimensional..?):</p>
  
  <pre><code>Array
          (
              [Female][N] =&gt; 11
              [Male][N] =&gt; 11
              [Humans][N] =&gt; 11
              [Adult][N] =&gt; 8
              [Adolescent][N] =&gt; 8
              [Reaction Time-physiology][N] =&gt; 6
              [Acoustic Stimulation-methods][N] =&gt; 6
              [Schizophrenia-genetics][Y] =&gt; 5
              [Motion Perception][N] =&gt; 3
          )
  </code></pre>
  
  <p>Can i use split method on key elements?</p>
  
  <p>Little bit harder... i also need to split on the single '_' underscore, i did this to prevent the columns getting mixed up... But the example below doesn't do the job right... </p>
  
  <pre><code>$new_array = array();
  foreach($MeshtagsArray as $key =&gt; $value) {
      $parts = explode('__', $key, 2);
      $parts2 = explode('_', $key, 2);
      $new_array[] = array(
          'discriptor' =&gt; $parts[0],
      'qualifier' =&gt; $parts2[1],
          'major' =&gt; $parts[1],
          '#occurence' =&gt; $value
      );
  </code></pre>
  
  <p>So the output should be something like:</p>
  
  <pre><code>[0] =&gt; Array
          (
              [discriptor] =&gt; Female
              [qualifier] =&gt; 
              [major] =&gt; N
              [#occurence] =&gt; 11
  ........
  [5] =&gt; Array
          (
              [discriptor] =&gt; Reaction Time
              [qualifier] =&gt; physiology
              [major] =&gt; N
              [#occurence] =&gt; 6
  </code></pre>
  
  <p>Best regards,
  Thijs</p>