0

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?

2
  • I think array_count_values is precisely what you're looking for. Commented Jan 24, 2022 at 17:18
  • See the function array_count_values(). Commented Jan 24, 2022 at 17:18

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.