[Solved] How to return array unique value? in php [closed]
[ad_1] <?php $items = [‘mani’ , ‘mani’, ‘nithi’, ‘nithi’, ‘basto’]; $counts = array_count_values($items); // Remove elements that occur more than once. $filtered = array_filter($items, function ($item) use ($counts) { return $counts[$item] === 1; }); var_export($filtered); Output: array ( 4 => ‘basto’, ) [ad_2] solved How to return array unique value? in php [closed]