I would like to remove duplicates by value as you can see from the list_title
. I know there are several questions and answers to this but their solution doesn't work for me.
Here is what I've tried:
$uniqueArray = array_map("unserialize", array_unique(array_map("serialize", $notify)));
Result:
Array
(
[0] => Array
(
[list_id] => 86
[list_reference] => 130948
[list_title] => Offer: apartment 2+kk
[list_city] => Prague
[list_date] => 2017-03-03 11:20:35
[list_status] => 0
[list_creator] => Company A
[list_price] => 30000
[list_furniture] => ["1","0","0"]
[list_accommodation] => flat
)
[1] => Array
(
[list_id] => 87
[list_reference] => 130947
[list_title] => Offer: apartment 2+kk
[list_date] => 2017-03-03 11:20:35
[list_status] => 0
[list_creator] => Company B
[list_price] => 30000
[list_furniture] => ["1","0","0"]
[list_accommodation] => flat
)
[2] => Array ...
Expected result should be one of those because of the title:
Array
(
[0] => Array
(
[list_id] => 86
[list_reference] => 130948
[list_title] => Offer: apartment 2+kk
[list_city] => Prague
[list_date] => 2017-03-03 11:20:35
[list_status] => 0
[list_creator] => Company A
[list_price] => 30000
[list_furniture] => ["1","0","0"]
[list_accommodation] => flat
)