当前位置:网站首页>找出数组中不重复的值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]边栏推荐
猜你喜欢

Gao Zelong, a famous digital collection expert and founder of the Digital Collection Conference, was interviewed by China Entrepreneur Magazine

Leetcode 70 stairs issues (Fibonacci number)

Flask failed to create database without error

db.sqlite3 has no "as Data Source" workaround

jvm线程状态

The Integer thread safe

Fragments

工控设备的系统如何进行加固

install flask

Use baidu EasyDL intelligent bin
随机推荐
数据库中间件-jdbi
String.toLowerCase(Locale.ROOT)
集合内之部原理总结
Teach you how to make the Tanabata meteor shower in C language - elegant and timeless (detailed tutorial)
像天才一样思考:如何培养自己的创造力?
How to find package information and pin definitions for NXP S32K1xx series microcontrollers
输入框最前面添加放大镜&&background-image和background-color冲突问题
锁执行的过程
VS2019 common shortcut keys
longest substring without repeating characters
报错:FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disab
Explain the wait() function and waitpid() function in C language in detail
idea中PlantUML插件使用
中英文说明书丨CalBioreagents 醛固酮单克隆抗体
Inception V3 闭眼检测
Search 1688 product interface by image (item_search_img-search 1688 product by image (Politao interface) code docking tutorial
The Integer thread safe
flask创建数据库失败未报错
The JVM thread state
Output method of list string print(*a) print(““.join(str(c) for c in a) )