Hi
Is it possible to count the values within an array that match specific criteria.
Lets say you have an array:
$myarray = array("dogs","cats","mice","dogs","cows","dogs","mice");
if i do count($myarray) i will obviously get 7.
What about if i want to know how mnay times "dogs" appears in the array. I've been playing with in_array but that only returns a true (1) or false (0) value:
echo in_array("dogs", $myarray);
//output is 1
I want to count how many times the word "dogs" is in that array.
Any ideas? I'm sure this is possible?
Cheers Ant