Codice PHP:
$result array_count_values(array(1,3,5,6,1));
var_dump($result[1]);//2