数组中重复值的计数

Below is the array : i need count of duplicate values in array for e.g. business=4

Array ( 
    [0] => Array ( [KRA_category] => Business )    
    [1] => Array ( [KRA_category] => Business ) 
    [2] => Array ( [KRA_category] => People ) 
    [3] => Array ( [KRA_category] => Business ) 
    [4] => Array ( [KRA_category] => Business ) 
    [5] => Array ( [KRA_category] => Business ) 
) 

You can combine array_column and array_count_values

$counts = array_count_values(array_column($array, 'KRA_category'));

you can count the duplicate values in php with

$vals = array_count_values(array_column($array, 'KRA_category'));

supported in 5.5 and above.

Input:

$array=[['KRA_category'=>'Business'],['KRA_category'=>'Business'],['KRA_category'=>'People'],['KRA_category'=>'Business'],['KRA_category'=>'Business'],['KRA_category'=>'Business']];

Code:

$counts=array_count_values(array_column($array,'KRA_category'));
array_walk($counts,function($v,$k)use(&$dupes){if($v>1){$dupes[$k]=$v-1;}});
var_export($dupes);

Output:

array (
    'Business' => 4,
)

Get the counts for each value in the column, then subtract -1 from each count ("the original", by the OP's meaning) and keep only counts that are more than 0.