PHP array_count_values
array_count_values is used to count the number of elements in the array ( Array ). When you put an array in array_count_values, the system will use the elements of the array as a new key and return a new Array containing the new key and key The key value is the number of occurrences in the original array. Although it is a bit abstract, it is easier to understand by looking at the following example.
PHP array_count_values syntax example
array_count_values (array input array to be queried)
PHP array_count_values implementation example
$Arr=array( "1" , "A" ,"1" ,"B" );
print_r(array_count_values($Arr)); // 輸出結果 Array ( [1] => 2 [A] => 1 [B] => 1 )
?>
 
 
Post a Comment
0 Comments