I have an array and need to remove if it is with the value of the from [id] duplicate item, I tried to do with:
$comments_new = array_map ("unserialize",
array_unique (array_map ("serialize", $ comments)))
But, there is no change.Template of my array.
Array
(
[0] => Array
(
[created_time] => 2018-10-28T17:35:58+0000
[from] => Array
(
[name] => Usuario
[id] => 111111
)
[message] =>test as das
[id] => 4234234214123412341234124
)
[1] => Array
(
[created_time] => 2018-10-28T17:35:24+0000
[from] => Array
(
[name] => Usuario2
[id] => 22222222
)
[message] => test
[id] => 12341241234134444343
)
[2] => Array
(
[created_time] => 2018-10-28T18:44:08+0000
[from] => Array
(
[name] => Usuario3
[id] => 33333333
)
[message] => ccccc
[id] => 223423421243123412341234123
)
[3] => Array
(
[created_time] => 2018-10-28T18:43:44+0000
[from] => Array
(
[name] => Usuario2
[id] => 22222222
)
[message] => test other
[id] => 23424123412341234
)
)
Note that inside the array there is the ID item, it is for this item that it must be checked if it is duplicated, then I must remove the record from the array.