How can I get the frequency of an item in a field contained in the following array?

```
//
...
...
//database stuff
while($row=mysql_fetch_array($result))
    { 

        //Retrieve tags for this article
    $tags=$row["art_tags"];

     $tagarray=explode(",",$tags);

    foreach($tagarray as $key  => $value)
        {

```

//need solution here  

//how to Search entire art\_tags field in the database and get frequency of all tags

```
echo $value; 

```

Eg.  

// Rice x 23 times  

// Beans x 12 times

```
}

```