ever try to remove duplicates in a php array?
by default array_unique() only treat the array items as strings, which may give surprised result
if your items are arrays in an array.
Add SORT_REGULAR option fix it.
$noDup= array_unique( $res, SORT_REGULAR);