Count matching values of a array in PHP

Very simple function to count matching values of a array.

function array_match_count($aa)
{
	$bb=array_unique($aa);
	print_r($bb);
	$numb=array();

foreach($aa as $a)
	{
		foreach($bb as $b)
		{	
			if(!isset($numb[$b]))
			{ 
				$numb[$b]=0; 
			}
			
			if($b==$a)
			{
				$numb[$b]++;
			}
		}
	}

	echo '<hr>';
	print_r($numb);

} //func end


$aa=array(
1=>'uk',
2=>'usa',
3=>'uk', 
4=>'uk', 
5=>'roi', 
6=>'roi', 
7=>'uae', 
8=>'bd', 
9=>'bd', 
10=>'bd', 
11=>'bd' );

array_match_count($aa);

Output:
Array ( [1] => uk [2] => usa [5] => roi [7] => uae [8] => bd )

Array ( [uk] => 3 [usa] => 1 [roi] => 2 [uae] => 1 [bd] => 4 )