array_count_values($var);

print_r(array_count_values($var));

array_count_values(); function is use for count how many common values in an array ??
To clearing the concept suppose you have an array where you have stored your friends names.
And you have one name of three friends suppose the name is Aiken. Here array_count_values($friends) will return you [Aiken] => 3 cause this function have found three same values in $friends array.

So we able to understand to count the same or common values in an array. 

Comments

Popular posts from this blog

WP register_post_type() with custom CMB2 meta box

Git post receive setup at server for git push to the production from local machine