此问题在此处已有答案:
Create an assoc array with equal keys and values from a regular array(3个答案)
昨天关门了。
有没有一种方法可以将一个现有的数组快速推入另一个数组?
$arr1 = [
"entry1",
"someEntry2",
"someEntry3",
];
$keys = [
[
"bla",
"bla" => [
"some other data"
]
],
[
"bla2",
"bla2" => [
"some other data"
]
],
[
"bla3",
"bla3" => [
"some other data"
]
],
];
最后,“final”数组应如下所示:
$final = [
"entry1" => [
"bla",
"bla" => [
"some other data"
]
],
"someEntry2" => [
"bla2",
"bla2" => [
"some other data"
]
],
"someEntry3" => [
"bla3",
"bla3" => [
"some other data"
]
],
];
是否已经有了一个内置函数或一个速记函数(可能通过使用回调)?
1条答案
按热度按时间6ljaweal1#
你可以试试这个:
结果: