How do i count same values in an array and store it to a variable?

Viewed 51162
$items = explode(',',$product); // values is 4,2,4,2,2,4

$unique_items=array_unique($items); // gives me 4,2

What code should be next to give me 4 = 3 , 2 = 3 and store the number of values to a variable?

3 Answers
Related