http://www.php.net/manual/en/function.array-count-values.php
----- Original Message ----- From: "jtjohnston" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, February 24, 2002 10:49 PM Subject: [PHP] Convert An Array > http://ccl.flsh.usherb.ca/db/authors_under_study.php > or > $names = array ("john", "mary", "bill", "mary", "bill", "mary", "bill", > "john", "bill", "john"); > > 1) How do I count the elements of $names to produce: > > bill 4 > john 3 > mary 3 > > 2) How do I store the counted elements into a new array? How do I create > this: > > $new_array = array ("bill"=>4, "john"=>3, "mary"=>3) > > I'm looking at http://www.php.net/manual/en/function.array.php > but not sure. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php