如何将 3 个平面数组声明为 3 行的 2d 数组?
如何将几个数组推入单个多维数组?
$array1 = ['apple' => 1, 'mango' => 5, 'banana' => 3];
$array2 = ['car' => 2, 'bus' => 7, 'moto' => 8];
$array3 = ['rain' => 14, 'snow' => 7, 'sun' => 12];
所需的新数组:
$newArray = [
['apple' => 1, 'mango' => 5, 'banana' => 3],
['car' => 2, 'bus' => 7, 'moto' => 8],
['rain' => 14, 'snow' => 7, 'sun' => 12]
];
How can I push a few arrays into a single multidimensional array?
$array1 = ['apple' => 1, 'mango' => 5, 'banana' => 3];
$array2 = ['car' => 2, 'bus' => 7, 'moto' => 8];
$array3 = ['rain' => 14, 'snow' => 7, 'sun' => 12];
Desired new array:
$newArray = [
['apple' => 1, 'mango' => 5, 'banana' => 3],
['car' => 2, 'bus' => 7, 'moto' => 8],
['rain' => 14, 'snow' => 7, 'sun' => 12]
];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这真的非常简单
或者更字面意思
It's really very simple
or more literally