Re: [PHP] Counting number of value instances within an array
Sorry - don't worry. Found the function I require. FYI : array_count_values() Neil Freeman wrote: > * > This Message Was Virus Checked With : SAVI 3.54 Feb 2002 > Last Updated 24th April 2002 > * > > Hi guys, > > Is there a function I can use to count the number of instances of a > value within an array. For example: > $a[0] = "bob"; > $a[1] = "bob"; > $a[2] = "fred"; > $a[3] = "james"; > $a[4] = "bob"; > $a[5] = "carl"; > > Searching for 'bob' would return 3. > > I've had a quick look through the array functions but didn't spot > anything obvious. > > Neil > > Email: [EMAIL PROTECTED] > [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Email: [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Counting number of value instances within an array
array_count_values() HTH Best regards, Andrey Hristov - Original Message - From: "Neil Freeman" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Friday, April 26, 2002 1:24 PM Subject: [PHP] Counting number of value instances within an array > Hi guys, > > Is there a function I can use to count the number of instances of a > value within an array. For example: > $a[0] = "bob"; > $a[1] = "bob"; > $a[2] = "fred"; > $a[3] = "james"; > $a[4] = "bob"; > $a[5] = "carl"; > > Searching for 'bob' would return 3. > > I've had a quick look through the array functions but didn't spot > anything obvious. > > Neil > > Email: [EMAIL PROTECTED] > [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php