Answer the question
In order to leave comments, you need to log in
How to count the number of repeated digits in an array, php?
Hello. Sorry for the possibly stupid question.
Started learning php.
There is an array with numbers, you need to find how many times each number occurs in this array.
Decided on this.
$array_n = array(1, 2, 3, 4, 5, 2, 4, 3, 5, 1, 2, 4, 5, 3, 5, 5, 3, 1);
$ac = array_count_values ($array_n);
print_r ($ac);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question