Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I will count my array value.
This is my array : $ar =array(10, 20, 20, 10, 10, 30, 50, 10, 20)
I need to count my value array, like the following: 10 there is 4 20 there is 3 30 there is 1 50 there is 1
how to do it?
array_count_values
array_count_values()
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
array_count_valuesis precisely what you're looking for.array_count_values().