I have the following array in php:
[0] => Array(
(
[post_id] => 492,
[user_id] => 1
)
[1] => Array(
(
[post_id] => 501,
[user_id] => 1
)
[2] => Array(
(
[post_id] => 568,
[user_id] => 13
)
[3] => Array(
(
[post_id] => 897,
[user_id] => 13
)
What I want to do, is to delete the ones where the user_id already exists. So the result should look like this:
[0] => Array(
(
[post_id] => 492,
[user_id] => 1
)
[1] => Array(
(
[post_id] => 568,
[user_id] => 13
)
I need an array, in which every user_id only exists one time.
array_unique() doesn't work for this example. Any ideas?
Thanks!