Php Count Duplicates In Array Python Question