Removing the last element in a do-while
<p>How can I remove the last element in a <code>do-while</code> generated table?</p>

<p>In my case the last <code>tr/td</code> where <code>div.dividing_line</code> is stored.</p>

<p>The code:</p>

<pre><code>$ArrayLength = 6; 
$i = 1;
do {
    echo '
    &lt;tr&gt;
        &lt;td valign="middle"&gt;Data_Position&lt;/td&gt;
        &lt;td valign="middle"&gt;Data_Item&lt;/td&gt;
        &lt;td valign="middle"&gt;Data_Pieces&lt;/td&gt;
        &lt;td valign="middle"&gt;Data_Price&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td colspan="4"&gt;&lt;div class="dividing_line"&gt;&lt;/div&gt;&lt;/td&gt;
    &lt;/tr&gt;
    ';
    ++$i;
} while ($i &lt; $ArrayLength+1);
</code></pre>

<p>For example: If I have an array with 6 items, normally the <code>do-while</code> will do the job, so finally there will be 6 <code>tr</code>'s with data and 6 <code>tr</code>'s with the <code>dividing_line</code>.</p>

<p>What I need is 6 <code>tr</code>'s of data and 5 <code>tr</code>'s of <code>dividing_line</code>. Is that possible?</p>
