If you want to find all the values that are duplicated in an array, you can do something like this:
$array = array('one', 'two', 'three', 'one');
$temp = array();
foreach ($array as $key)
{
if (!in_array($key, $temp))
{
$keys = array_keys($array, $key);
if (count($keys)>1)
{
$temp[] = $key;
echo 'Found: "'.$key.'" '.count($keys).' times at position: ';
for($a=0;$a<count($keys);$a++)
{
echo $keys[$a].',';
}
}
}
}
The conclusion from the above will be:
Found: "one" 2 times in the positions: 0.3,
If your array had user keys (as in a commented array), the output will be:
: "" 2 : a, d,