Is there a way to use Array_unique function working for nested array like below? I want to get rid of date duplicates and get two dates out as an array…
Array
(
[0] => Array
(
[value] => 1311044688
[name] => 19th Jul 2011
)
[1] => Array
(
[value] => 1311044919
[name] => 19th Jul 2011
)
[2] => Array
(
[value] => 1311045076
[name] => 19th Jul 2011
)
[3] => Array
(
[value] => 1311164873
[name] => 20th Jul 2011
)
[4] => Array
(
[value] => 1311165000
[name] => 20th Jul 2011
)
)
I’d write this array to another array using the date as the keys, and the “values” as the value. That’s probably the fastest way to achieve what you’re looking for.
Something like:
You’d probably want to include a bit of logic to determine which value takes precedence in case of dupes.