<?php $array = [2,4,3,6,3,2,5,5]; $arr=array_count_values($array); foreach ($arr as $k=>$v){ if($v==1){ $str[]=$k; } } print_r($str);