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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count entries in array? 1

Status
Not open for further replies.

ThomasJSmart

Programmer
Joined
Sep 16, 2002
Messages
634
im having a small array problem,

$array = 1,2,2,3,1,2,2,4,1,4,4,4
(where each number is a seperate var)

i know the total, $total = count($array), returns 12

but how do i count how many of each vars there are in the aray?

im trying to get it to echo the contents of the array but i dont wont vars repeating.

final echo would be something like this:

1 (3x)
2 (4x)
3 (1x)
4 (4x)

im kinda stuck tho, any help much apreciated

thanks,
Thomas



I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
wicked, thanks!

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top