作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<分区>
我有一个数组:
$main_arr = [
0=>[
"el 01",
"el 02",
"el 03",
],
1=>[
"el 11",
"el 12",
"el 13",
],
2=>[
"el 21",
"el 22",
"el 23",
],
];
在 php 中是否有像 ninja_array_method($main_arr, "el new")
这样的函数或单个语句将新元素添加到所有子数组中:
$main_arr = [
0=>[
"el 01",
"el 02",
"el 03",
"el new",
],
1=>[
"el 11",
"el 12",
"el 13",
"el new",
],
2=>[
"el 21",
"el 22",
"el 23",
"el new",
],
];
我只想将这些元素“el new”添加到所有数组中,而不用在一行中进行任何更改,或者只是像 add_el($main_arr, "el new") 这样的方法
我是一名优秀的程序员,十分优秀!