PHP array_count_values() function

P
PHP array_combine() function
PHP array_diff() function

array_count_values() function in PHP simply return the count of the values.

What is the syntax of array_count_values() in PHP?

array_count_values(array)
ParameterDetails
arraySpecify the array to count values of – required
array_count_values

Example of array_count_values function

<?php
$array = array("J","Horse","Sparrow","Parrot","Cat");
print_r(array_count_values($array));
?>

Return an associative array containing the keys and their values.

PHP array_combine() function
PHP array_diff() function

Add comment

Tutor Network

Share this

Learn PHP from A to Z