Page 1 of 1

duplicate values within an array?

Posted: Sun Jul 24, 2005 4:11 pm
by mudvein
how can i count how many times a key is found within an array?

ie :

$array = ('bob','sam','sally','bob');

I want to be able to say bob has appeared within this array twice. is that possible? if so, how? thanks.

Posted: Sun Jul 24, 2005 4:12 pm
by mudvein
i guess i should look this up before i post. the answer is to use array_count_values

Posted: Sun Jul 24, 2005 4:17 pm
by shiznatix
ha good work finding it out urself