当前位置:网站首页>PHP two-dimensional array to heavy
PHP two-dimensional array to heavy
2022-08-06 18:28:00 【New and old farmers】
$2dData 是二维数组
$2dData = array(
array('id' => 0, 'value' => 'Green tags'),
array('id' => 1, 'value' => 'Red tags'),
array('id' => 1, 'value' => 'Red tags'),
);
二维数组去重
$tmp = array();
$result = array();
foreach($2dData as $key => $val){
$tmp[$key] = json_encode($val);
}
unset($val);
$final = array_unique($tmp);
foreach($final as $key => $val){
$result[$key] = json_decode($val, true);
}
结果:
$result= array(
array('id' => 0, 'value' => 'Green tags'),
array('id' => 1, 'value' => 'Red tags'),
);
边栏推荐
- 作业8.6 进程间的通信 消息队列与共享内存
- 数学建模学习(79):Matlab神经网络工具箱使用,实现多输入多输出预测
- 对标西湖大学,年薪60万博士后招聘来了
- Nacos源码分析专题(四)-服务发现
- [The Beauty of Software Engineering - Column Notes] 39 | Project Summary: Do a good job in project review and turn experience into ability
- Sql注入的基础
- Cut, printf, awk, sed commands for shell string screenshot commands
- 好消息|又一省22年二建成绩查询时间公布
- “蔚来杯“2022牛客暑期多校训练营3
- What is amazon measurement system, how cross-border sellers by myself have no quickly out of the list?
猜你喜欢

小熊派的学习——内核开发(信息量、事件管理、互斥锁、消息队列)

ESP8266-Arduino programming example-L9110 DC motor fan sensor module

Paper reading notes (5) - Extracting the contours of individual cows from images using the enhanced mask R-CNN instance segmentation method

一个优秀的 Web3项目具备的特点

七夕,你来人间一趟,总要谈一场轰轰烈烈的恋爱

12 异常处理器

小熊派的学习—驱动系统开发

DNS外带注入

吴恩达深度学习deeplearning.ai——第一门课:神经网络与深度学习——第三节:浅层神经网络

Sketch91:如何设置对齐的参考对象,根据指定元素进行对齐教程
随机推荐
Redis basis
CarSim仿真快速入门(十七)—ADAS范围和跟踪传感器
APP自动化测试-6.断言处理assert与hamcrest
星起航:跨境电商试综区为广大卖家提供更多的市场发展机遇
深度学习之基础知识
Paper Reading Notes (2) - Mask R-CNN
小熊派的学习—驱动系统开发
#yyds干货盘点# 面试必刷TOP101:判断一个链表是否为回文结构
Apifox和Apipost有什么区别?那个更有优势(接口工具)postman、jmeter等等、、、
mosquitto使用的基本流程以及一些遇见的问题
Sketch91: How to set an aligned reference object and align it according to the specified element tutorial
Redux知识点总结
Euro-NCAP-2023 Safety Assisted Collision Avoidance System Test Procedure Chinese Version
大算力时代已经到来
JUC并发容器1(CopyOnWriteArrayList、CopyOnWriteArraySet、ConcurrentSkipListSet)
antd的表格有多选框时翻页记住之前选择的数据
[The Beauty of Software Engineering - Column Notes] 39 | Project Summary: Do a good job in project review and turn experience into ability
PyTorch框架构建花朵图像分类模型(Resnet网络,迁移学习)
云计算-存算一体-EDA-技术杂谈
jni学习4.动态注册