PHP: Count values of array

Posted by poru on Stack Overflow See other posts from Stack Overflow or by poru
Published on 2010-03-13T00:08:10Z Indexed on 2010/03/13 0:17 UTC
Read the original article Hit count: 595

Filed under:
|
|

I know the function count() of php, but what's the function for counting how often a value appear in an array?

Example:

$array = array(
  [0] => 'Test',
  [1] => 'Tutorial',
  [2] => 'Video',
  [3] => 'Test',
  [4] => 'Test'
);

Now I want to count how often "Test" appears.

© Stack Overflow or respective owner

Related posts about php

Related posts about array