Why does this loop give up halfway through?
<p><code>$list</code> is a very large array with a series of words, some of which are greater than 5 characters and some of which are smaller. This loop will unset all values where the length of the word is longer than 5 chars.</p>

<pre><code>for($i = 0; $i &lt; count($list); $i++)
{
    $list[$i] = trim($list[$i]);
    if(strlen($list[$i]) &gt; 5)
    {
        unset($list[$i]);
    }
}
</code></pre>

<p>However, it does that for about half of $list and cuts out dead, there's words which are significantly longer than 5 letters still left in the list, but only starting approximately halfway through. What makes it quit? Should I run that loop multiple times?</p>
