I've got an associative array with some duplicate items. For example, I have:
<?
$group_array = array('user_id'=>array(), 'user_first'=>array());
Which outputs something like below:
Array
(
[user_id] => Array
(
[0] => 594
[1] => 597
[2] => 594
)
[user_first] => Array
(
[0] => John
[1] => James
[2] => John
)
)
I'd like to sanitize this entire array so that only the user John will show up once (based on user_id).
I've tried the following:
<?php
$unique = array_unique($group_array);
print_r($unique);
But it does not appear to work. Any other ideas how I can remove the duplicate items in the array?
Any help would be great!