$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?
$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?
check here : array_count_values() https://www.w3schools.com/php/showphp.asp?filename=demo_func_array_count_values