Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

find the occurrence of array values in php using array function

$array = array(1, 2, 3, 3, 3, 4, 4, 5, 6, 6, 6, 6, 7);
print_r(array_count_values($array));

Result:

Array
( [1] => 1 ,[2] => 1 , [3] => 3, [4] => 2,[5] =>1, [6] => 4, [7] => 1 )
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #occurrence #array #values #php #array #function
ADD COMMENT
Topic
Name
3+6 =