does anyone know of a way to find out if a number appears in an array more than once, is there an array function which will do this? for instance if i had an array with values "2,2,3,4" and i executed this function it would return true wheras if i had an array with values "1,3,3" and i executed the function it would return false.
can anyone help?
[SOLVED] array function
Moderator: General Moderators
untested
Code: Select all
function foo($array)
{
return count($array) == count(array_unique($array));
}-
dannymc1983
- Forum Commoner
- Posts: 80
- Joined: Wed Feb 16, 2005 7:24 am