title: PHP reorder keys in array by template
body: <p>i have array like this:</p>
  
  <pre><code>$array = array(
              array(
                  'Date' =&gt; '2015-10-23',
                  'Week Day' =&gt; 'Friday',
                  'Hour' =&gt; 'asdads',
                  'Intoduction' =&gt; 'adsasdasdasd​',
                  'Call Status' =&gt; 'asdadad:',
                  'Call status options' =&gt; 'asdadsad',
                  'Question 1' =&gt; 'asdadads',
                  'Answer 1' =&gt; 'Psdado',
                  'Question 2' =&gt; 'asdadadsasd',
                  'Answer 2' =&gt; 'aasdadasdads',
                  'Telephone 1' =&gt; 'asdadsadsqd',
                  'Status tel 1' =&gt; 'asdasdad'
          ),
              array(
                  'Date' =&gt; '2015-10-23',
                  'Week Day' =&gt; 'Friday',
                  'Hour' =&gt; 'asdads',
                  'Intoduction' =&gt; 'asdadadsasdad',
                  'Call Status' =&gt; "asdadsasdasd",
                  'Call status options' =&gt; 'Busy',
                  'Telephone 1' =&gt; 'asdadsasd',
                  'Status tel 1' =&gt; 'sdasdasdad',
                  'Question 1' =&gt; '',
                  'Answer 1' =&gt; '',
                  'Question 2' =&gt;'',
                  'Answer 2' =&gt;''
              ) ...
  );
  </code></pre>
  
  <p>Other arrays that follows, keys are mixed up but they all have the same keys.
  I want to sort all arrays keys with same order,
  Example by default to be $array[0], and next $array[1],$array[2], ... all to have keys in order by $array[0] .</p>
  
  <p>If input is array from top, result should be:</p>
  
  <pre><code>$array = array(
      array(
          'Date' =&gt; '2015-10-23',
          'Week Day' =&gt; 'Friday',
          'Hour' =&gt; 'asdads',
          'Intoduction' =&gt; 'adsasdasdasd​',
          'Call Status' =&gt; 'asdadad:',
          'Call status options' =&gt; 'asdadsad',
          'Question 1' =&gt; 'asdadads',
          'Answer 1' =&gt; 'Psdado',
          'Question 2' =&gt; 'asdadadsasd',
          'Answer 2' =&gt; 'aasdadasdads',
          'Telephone 1' =&gt; 'asdadsadsqd',
          'Status tel 1' =&gt; 'asdasdad'
      ),
      array(
          'Date' =&gt; '2015-10-23',
          'Week Day' =&gt; 'Friday',
          'Hour' =&gt; 'asdads',
          'Intoduction' =&gt; 'asdadadsasdad',
          'Call Status' =&gt; "asdadsasdasd",
          'Call status options' =&gt; 'Busy',
          'Question 1' =&gt; '',
          'Answer 1' =&gt; '',
          'Question 2' =&gt;'',
          'Answer 2' =&gt;'',
          **'Telephone 1' =&gt; 'asdadsasd',
          'Status tel 1' =&gt; 'sdasdasdad'**
      )
  );
  </code></pre>