Hello all im trying to find duplicate x values from this array and remove them and only leave the unique ones. For example my array is
Array ( [0] => Arr
Just loop through and find unique values as you go:
$taken = array(); foreach($items as $key => $item) { if(!in_array($item['x'], $taken)) { $taken[] = $item['x']; } else { unset($items[$key]); } }
Each the first time the x value is used, we save it - and subsequent usages are unset from the array.
x
unset