Sorting a table by the results of an array
<p>In the table below, <code>$count1</code> is a numerical value.  How do I sort the table by <code>$count1</code> descending?</p>

<pre><code>        $words = explode(" ", $commentstring);
        $result = array_combine($words, array_fill(0, count($words), 0));

        foreach($words as $word) {
        $result[$word]++;
        }


        echo "&lt;table&gt;";

        foreach($result as $word =&gt; $count1) {

        echo '&lt;tr&gt;';    
        echo '&lt;td&gt;';
        echo "$word";
        echo '&lt;/td&gt;';

        echo '&lt;td&gt;';
        echo "$count1 ";
        echo '&lt;/td&gt;';

        echo '&lt;/tr&gt;';

        }

        echo "&lt;/table&gt;";
</code></pre>
