<?php $array = array('a','b','',''); var_dump(array_count_values($array));
Standard input is empty
array(3) { ["a"]=> int(1) ["b"]=> int(1) [""]=> int(2) }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!