how to get array with inside array of duplicate rows code example
Example 1: check duplicate data in array php
$counts = array_count_values($array);
$duplicate_title = array_filter($array, function ($value) use ($counts) {
return $counts[$value] > 1;
});
Example 2: laravel remove duplicates from array
$array = array(1, 2, 2, 3);
$array = array_unique($array); // Array is now (1, 2, 3)