$arr = array('2','4','5','8','4','10','2','10','2');
// 计算数组中每个值出现的次数
$arr = array_count_values($arr);
// key是值,value是次数
$one = [];
foreach ($arr as $key => $value) {
if($value == 1){
$one[] = $key;
}
}
print_r($one);
//打印结果[5,8]