Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Array, display items and how many times each appear

Status
Not open for further replies.
May 13, 2005
56
US
So lets say I have an array
$array=array(1,2,3,4,5,6,7,8,9,10,4,5,6,4);

I want an output of each number and how many times it appears in the array..

for example this would be great

4 - 3 times
5 - 2 times
6 - 2 times
1- 1 time
etc....

Is there any built in function to do this?

Thanks,

Mike

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top