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.
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
Post a Comment