title: PHP Array Changes
body: <p>I have data that's setup the following way:</p>
  
  <pre><code>array(
        0 =&gt; array(
                    'data_id' =&gt; 0,
                    'elem_value' =&gt; 'phone',
                    'elem_prettyname' =&gt; 'Phone Number'
                   ),
        1 =&gt; array(
                    'data_id' =&gt; 0,
                    'elem_value' =&gt; 'email',
                    'elem_prettyname' =&gt; 'Email Address'
                   ),
        2 =&gt; array(
                    'data_id' =&gt; 1,
                    'elem_value' =&gt; 'phone',
                    'elem_prettyname' =&gt; 'Phone Number'
                   ),
        3 =&gt; array(
                    'data_id' =&gt; 1,
                    'elem_value' =&gt; 'email',
                    'elem_prettyname' =&gt; 'Email Address'
                   )
       )
  )
  </code></pre>
  
  <p>I'm trying to turn that into a csv file that looks like:</p>
  
  <pre><code>"Data ID","Phone Number","Email Address"
  0,"phone","email"
  1,"phone","email"
  </code></pre>
  
  <p>But I can't figure it out for the life of me. I have tons of random arrays and they go nowhere.</p>
  
  <p>I should mention that the elem_prettyname can have an infinite number of elements.. IE not just Phone Number and Email Address.</p>
  
  <p>Can anyone point me in the right direction to get that formatted correctly?</p>
  
  <p>Thanks in advance.</p>