check duplicate data in array php
snippet in php

check duplicate data in array php

user9051

$counts = array_count_values($array);
            $duplicate_title  = array_filter($array, function ($value) use ($counts) {
                return $counts[$value] > 1;
            });