当前位置:网站首页>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'
]
]
边栏推荐
- SDN system method | 9 Access network
- New and old cluster migration of Minio data
- 如果你也想做自媒体,不妨听大周给您点建议
- sklearnex 让你的 sklearn 机器学习模型训练快得飞起?
- Uncover gaussdb (for redis): comprehensive comparison of CODIS
- 2022 meisai topic C idea sharing + translation
- Lighten the source code -- lighten the app system development function introduction to the beautiful world lighten the app system development source code in China
- Controllable character image synthesis based on attribute decomposition and Gan reproduction
- 网络 | traceroute,路由跟踪命令,用于确定 IP 数据包访问目标地址所经过的路径。
- Rank sum ratio comprehensive evaluation method for common models in mathematical modeling
猜你喜欢
![[论]Learning Dynamic and Hierarchical Traffic Spatiotemporal Features with Transformer](/img/58/d68112a3d019de66150e2f5102f436.png)
[论]Learning Dynamic and Hierarchical Traffic Spatiotemporal Features with Transformer

A commonly used statistical modeling method -- difference analysis

Installation and removal of MySQL under Windows

Explain factor analysis in simple terms, with case teaching (full)

PD1.4转HDMI2.0转接线拆解。

Service charge and time setting code sharing involved in crmeb withdrawal process

An article clearly explains MySQL's clustering / Federation / coverage index, back to table, and index push down

ECSHOP commodity page multi-attribute batch purchase plug-ins ECSHOP wholesale plug-ins multi-attribute order placing, multi-attribute batch purchase of commodities

Today, I will explain to you what is DFI and its development prospects

15、wpf之button样式小记
随机推荐
Dark horse shopping mall ---1 Project introduction - environment construction
ARM 立即数
Renrenyue -- renrenyue system development source code sharing
Is it safe to open an account and buy stocks on the Internet?
devsecops与devops的理解与建设
The whole page turns gray
Image tagging to obtain the coordinates of the image in the ImageView
ECSHOP quickly purchases goods, simplifies the shopping process, and improves the user experience through one-step shopping
An easy-to-use seal design tool - (can be converted to ofd file)
plt.gca()画框及打标签
Arm immediate
K8s, docker compose install MySQL 8.0.18
[regression analysis] understand ridge regression with case teaching
Web project development process
Pycaret successfully resolved the problem that 'sklearn model_ selection._ Search 'import name "\u check\u param\u grid"
confluence7.4. X upgrade record
How to use SPSS to do grey correlation analysis? Quick grasp of hand-to-hand Teaching
ThinkPHP upload image compression size
2022 meisai topic C idea sharing + translation
flutter常用命令及问题