PHP Array count and get element values
<p>I'm pretty new to PHP and programming so I'm having troubles with this thing.</p>

<p>The purpose of the whole situation is to read a column from tab delimited file (already did that), get all different items in it, count them individually and put them in table with <br><br>Column1[item value - label], Column2[count].</p>

<p>I have the whole column in 1 dimension array. Now, I want to list all the items there and their counts beside. The problem is, I could have more than 10 different items, even more, so I can't do it manually (name 10 variables and count each) like this:</p>

<pre><code>$arr = array("complete","fail","complete","exit","fail","fail","complete");
function isComplete($value){
    return ($value == "complete") ? true : false;
}

$complete = array_filter($array, 'isComplete');

&lt;tr&gt;
   &lt;td&gt;Complete&lt;/td&gt;
   &lt;td&gt;&lt;?php echo count($complete)?&gt;&lt;/td&gt;
&lt;/tr&gt;

-- &gt; Complete = 3
</code></pre>

<p>I want to avoid manually creating every function for each value because values can differ from file to file.</p>

<p>The number of items in $array can go up to 20+k so I need all automated. Can someone help me with this?</p>
