当前位置:网站首页>PHP appends the same elements to a two-dimensional array
PHP appends the same elements to a two-dimensional array
2022-06-25 12:29:00 【Chafferer WANG】
$origin_arr = [
[
'a'=>'a1',
'b'=>'b1',
'c'=>'c1',
],
[
'a'=>'a2',
'b'=>'b2',
'c'=>'c2',
]
]
$add_arr= [
'user_source'=>'test'
];
array_walk($origin_arr, function (&$value, $key, $add_arr) {
$value = array_merge($value, $add_arr);
}, $add_arr);
print_r($origin_arr);
// Print the results
[
[
'a'=>'a1',
'b'=>'b1',
'c'=>'c1',
'user_source'=>'test'
],
[
'a'=>'a2',
'b'=>'b2',
'c'=>'c2',
'user_source'=>'test'
]
]
边栏推荐
- What is the primordial universe
- New and old cluster migration of Minio data
- 机器学习自学成才的十条戒律
- The whole page turns gray
- 一款好用的印章设计工具 --(可转为ofd文件)
- If you also want to be we media, you might as well listen to Da Zhou's advice
- R language uses ordinal or. The display function obtains the summary statistical information of the ordered logistic regression model (the odds ratio and its confidence interval corresponding to the v
- 刷入Magisk通用方法
- ECSHOP upload video_ ECSHOP video list, video classification, video related product guide
- How to use ARIMA model for prediction?
猜你喜欢
How to use ARIMA model for prediction?
[论]Learning Dynamic and Hierarchical Traffic Spatiotemporal Features with Transformer
[on]learning dynamic and hierarchical traffic spatiotemporal features with transformer
Explanation of ideas and sharing of pre-processing procedures for 2021 US game D (with pre-processing data code)
[data midrange] what is the oneid of the data midrange? Isn't the master data fragrant?
揭秘GaussDB(for Redis):全面对比Codis
2022 meisai topic C idea sharing + translation
Uncover gaussdb (for redis): comprehensive comparison of CODIS
一套自动化无纸办公系统(OA+审批流)源码:带数据字典
Why do we do autocorrelation analysis? Explain application scenarios and specific operations
随机推荐
动态代理
Zhengzheng e-commerce source code -- Zhengzheng advertising e-commerce system development source code sharing
R语言dplyr包filter函数过滤dataframe数据中指定数据列的内容不是(不等于指定向量中的其中一个)指定列表中的数据行
Renrenyue -- renrenyue system development source code sharing
Explain factor analysis in simple terms, with case teaching (full)
The whole page turns gray
20. MVVM command binding of WPF
Découvrir gaussdb (pour redis): une comparaison complète avec Codis
Ubuntu uninstalling PHP
Dark horse shopping mall ---6 Brand, specification statistics, condition filtering, paging sorting, highlighting
A set of automated paperless office system (oa+ approval process) source code: with data dictionary
What is Flink? What can Flink do?
devsecops与devops的理解与建设
New and old cluster migration of Minio data
揭秘GaussDB(for Redis):全面对比Codis
sudo: ulimit: command not found
[论]Learning Dynamic and Hierarchical Traffic Spatiotemporal Features with Transformer
The dist function of R language calculates the distance between two samples in dataframe data, returns the distance matrix between samples, and specifies the distance calculation method through the me
Spicy food advertising e-commerce system development function and spicy food advertising e-commerce app system development source code sharing
The network traceroute command is used to determine the path through which IP packets access the destination address.