Home >> PHP >> array_count_values() function in PHP

array_count_values() function in PHP

The array_count_values() function used for counts all the values of an array.




print_r( array_count_values(array("Ram","Shyam","Ghanshyam","Ram","Shyam")));


Array ( [Ram] => 2 [Shyam] => 2 [Ghanshyam] => 1 )

Post Your Comment

Next Questions
array_diff() function
array_diff_assoc() function
array_diff_key() function
array_diff_uassoc() function
array_diff_ukey() function
array_fill() function
array_filter() function
array_flip() function
array_intersect() function
array_intersect_assoc() function
array_intersect_key() function
array_intersect_uassoc() function
array_intersect_ukey() function
array_key_exits() function
array_keys() function
array_map() function
array_merge() function
array_merge_recursive() function
array_multisort() function
array_pad() function
array_pop() function
array_product() function
array_push() function
array_rand() function
array_reduce() function

Copyright ©2022 coderraj.com. All Rights Reserved.