我在类似的问题上看到了另一个问题,但我的问题似乎很明显。
我有两个数组:
阵列#1:
Array
(
[1] => Baby/Juvenile
[2] => Bedding
[3] => Room Decor
[4] => Bath & Potty
[5] => Feeding
[7] => Furniture
[8] => Bath
[9] => Towels
[10] => Shower Curtains
)
阵列 #2
Array
(
[1] => 5
[2] => 7
[3] => 9
)
我想比较这些数组并根据第二个数组中的值从第一个数组中提取键/值对。我想要的输出是:
Array
(
[5] => Feeding
[7] => Furniture
[9] => Towels
)
我玩过各种数组函数,但似乎无法弄清楚,任何提示将不胜感激,谢谢!