title: php swap table rows columns (array)
body: <p>I have an array, for example <code>(1,2,3,4,5,6,7,8,9,10)</code>.
  I want it in a table.  I can do this:</p>
  
  <pre><code>|-------------------------------|
  |   1   |  2  |  3  |  4  |  5  |
  |-------------------------------|
  |   6   |  7  |  8  |  9  |  10 |
  |-------------------------------|
  </code></pre>
  
  <p>But I want this:</p>
  
  <pre><code>|-------------------------------|
  |   1   |  3  |  5  |  7  |  9  |
  |-------------------------------|
  |   2   |  4  |  6  |  8  |  10 |
  |-------------------------------|
  </code></pre>
  
  <p>The number of columns is fixed (for example 5). The number of rows must be homogeneous, for example <code>(2, 2, 2, 2, 2)</code> or <code>(3, 3, 2, 2, 2)</code> or <code>(3, 3, 3, 3, 2)</code>, NOT <code>(4, 3, 3, 2, 2)</code> and NOT <code>(2, 2, 3, 3, 3)</code>...</p>
  
  <p>How can I do this?</p>
  
  <p>PS: the table is in html!</p>