当前位置:网站首页>找出数组中不重复的值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]
边栏推荐
- 报错jinja2.exceptions.UndefinedError: ‘form‘ is undefined
- String.toLowerCase(Locale.ROOT)
- [HNOI2002]营业额统计
- 2022-08-08: Given an array arr, it represents the height of the missiles that will appear in order from morning to night.When the cannon shoots missiles, once the cannon is set to shoot at a certain h
- 线程池总结
- db.sqlite3 has no "as Data Source" workaround
- static静态关键字和继承
- 阿里巴巴官方技术号
- 分布式id 生成器实现
- A test engineer with an annual salary of 35W was laid off. Personal experience: advice that you have to listen to
猜你喜欢
zip压缩包密码解密
A test engineer with an annual salary of 35W was laid off. Personal experience: advice that you have to listen to
C# 利用iTextSharp画PDF
C language implements sequential stack and chain queue
代码目录结构
Quectel EC20 4G module dial related
C语言实现顺序栈和链队列
Built-in macros in C language (define log macros)
db.sqlite3 has no "as Data Source" workaround
Use baidu EasyDL intelligent bin
随机推荐
VS2019 common shortcut keys
简单使用Lambda表达式
Unity Gobang Game Design and Simple AI(3)
报错jinja2.exceptions.UndefinedError: ‘form‘ is undefined
Explain the wait() function and waitpid() function in C language in detail
治疗消化性溃疡—Toronto Research Chemicals 甘氨酸铝
flask创建数据库失败未报错
我入职阿里后,才知道原来简历这么写
逆向工程
缓存技术使用
db.sqlite3没有“as Data Source“解决方法
2017.10.26模拟 b energy
sql problem solving statement to create a table
Program Performance Analysis - Complexity Analysis
Error jinja2.exceptions.UndefinedError: 'form' is undefined
输入框最前面添加放大镜&&background-image和background-color冲突问题
DDD 领域驱动设计
pycharm环境包导入到另外一个环境
uniapp实现防抖搜索
cut命令的使用实例