<?php $array = ['10','20','10','30','20','10',20];print_r(array_count_values($array));
Standard input is empty
Array ( [10] => 3 [20] => 3 [30] => 1 )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!