I have the following array:
$myarray = Array(\"2011-06-21\", \"2011-06-22\", \"2011-06-22\", \"2011-06-23\", \"2011-06-23\", \"2011-06-24\", \"2011-06-24\",
I'll answer the second question first. You want to use array_keys with the "search_value" specified.
$keys = array_keys($array, "2011-06-29")
In the example below, $duplicates will contain the duplication values while $result will contain ones that are not duplicates. To get the keys, simply use array_keys.
Result:
// $duplicates
Array
(
[1] => a
)
// $result
Array
(
[2] => b
[3] => c
[4] => d
)
// $unique_keys
Array
(
[0] => 2
[1] => 3
[2] => 4
)
// $duplicate_keys
Array
(
[0] => 0
[1] => 1
)