I have a multidimensional array such as
Array
(
[0] => Array
(
[id] => 1355698
[comment] => hello
)
[1] => Array
(
[id] => 1355699
[comment] => hey
)
[2] => Array
(
[id] => 1355700
[comment] => hello
)
)
The id
will always be unique, so the uniqueness of the element will be based on the subarray's value of comment
. In this case, array[0]
has a duplicate array[2]
. (I wonder if there is a better way to phrase this explaination).
array_unique()
will not work in this case. Is there an alternative? Thanks!