当前位置:网站首页>Finds an array based on the value of a field in a two-dimensional array
Finds an array based on the value of a field in a two-dimensional array
2022-04-21 07:55:00 【Mars Murong】
/**
* Finds an array based on the value of a field in a two-dimensional array
*
* @param array $array
* @param string $index
* @param string $value
* @return array
*/
public static function filter_by_value($array, $index, $value)
{
if (is_array($array) && count($array) > 0) {
foreach (array_keys($array) as $key) {
$temp[$key] = $array[$key][$index];
if ($temp[$key] == $value) {
$newarray[$key] = $array[$key];
}
}
}
return $newarray;
}
版权声明
本文为[Mars Murong]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210629261601.html
边栏推荐
猜你喜欢

MySQL5.7安装操作手册(Centos7)

kubesphere3. 0 forgot admin password

Flutter first experience

Flutter 环境搭建等基础

STM32系统和自定义bootloader的实现和应用

Introduction to btstack 1.0 of Bluetooth open source protocol stack

Understanding of data warehouse ODS, DW and DM concepts in data governance platform

The fifth stop is the hometown of Confucius and Mencius ------- the shortest path to the maze

matlab画散点图
![[Niuke brush question 18] find the longest common substring in two strings a and B](/img/eb/d86b667deca3890259fac999324cd4.png)
[Niuke brush question 18] find the longest common substring in two strings a and B
随机推荐
蓝牙开源协议栈BTstack汇总
C# asp.net 调百度文字识别接口
leetcode 203. Remove linked list elements
An entity class maps a field
asp. Net re regular expression, filter the amount of time order number in the returned string, and convert the non-standard time format into the correct time format
Postgre (PG) - SQL script record
OmniPlan tool user manual
[image fusion] image fusion based on Laplace pyramid + wavelet transform, including Matlab source code
Self made webserver from scratch (XV) -- the log base part is completed, and the practical widget double-buffering optimizes the asynchronous write performance
实体类映射一个字段
使用Hutool的流方式读取Excel大文件
Unity performance optimization UI
laravel实现打包多个文件,并下载
如何修改 Rancher Server 的 IP 地址
Dynamic programming fixed-point breakthrough -- leetcode topic 64 Minimum path sum
playwright click timeout属性,等待元素出现的时间
Supplément à la fonction d'annotation
GoLang项目开发基础
leetcode题目--120.三角形最小长度和,简单dp
常用sql