当前位置:网站首页>找出数组中不重复的值php
找出数组中不重复的值php
2022-08-09 06:35:00 【大得369】
$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]
边栏推荐
- zip压缩包密码解密
- 线程池总结
- Simple to use Lambda expressions
- TCP segment of a reassembled PDU
- Altium designer software commonly used the most complete package library, including schematic library, PCB library and 3D model library
- Altium designer软件常用最全封装库,包含原理图库、PCB库和3D模型库
- 报错:flask: TypeError: ‘function‘ object is not iterable
- Common Oracle Commands
- Unity C# 委托——事件,Action,Func的作用和区别
- 思维方法 解决问题的能力
猜你喜欢
Fragments
中英文说明书丨TRC 交替醇(Catalogue NumberA575760)
static静态关键字和继承
Redis 2 - 高级
中英文说明书丨TRC D-阿卓糖(D-Altrose)
Unity C# 委托——事件,Action,Func的作用和区别
使用百度EasyDL实现智能垃圾箱
C language implements sequential stack and chain queue
INSTALL_RPATH and BUILD_RPATH problem in CMake
The working principle of the transformer (illustration, schematic explanation, understand at a glance)
随机推荐
SIGINT,SIGKILL,SIGTERM信号区别,各类信号总结
2022.8.8DAY628
抗菌药物丨Toronto Research Chemicals 天冬酰胺D
什么是excel文件保护
Excel受保护的工作表怎么操作?
mysql 总结
uniapp实现防抖搜索
Simple Factory Pattern
Transaction concluded
golang xml 处理动态属性
使用百度EasyDL实现智能垃圾箱
C language implements sequential stack and chain queue
leetcode 之盛水问题
Service
AD picture PCB tutorial 20 minutes clear label shop operation process, copper network
字节跳动笔试题2020 (抖音电商)
golang zip aes base64
我入职阿里后,才知道原来简历这么写
Unity C# 委托——事件,Action,Func的作用和区别
线程的6种状态