0
我在PHP兩個數組,我需要做一個新的數組出他們的陣列...在PHP中使用鍵和值處理兩個數組?
array(2) {
["required"]=> array(4) {
["broom handle"]=> int(1)
["metal plate"]=> int(1)
["bolt"]=> int(2)
["motivation"]=> int(1)
} ["userItems"]=> array(4) {
["broom handle"]=> string(4) "1000"
["metal plate"]=> string(4) "1000"
["bolt"]=> string(4) "1400"
["motivation"]=> string(4) "1000"
}
}
我想要做的就是採取的userItems
值和值除以它required
這裏的關鍵匹配,我試過使用array_walk
和array_map
,但永遠不能正確嗎?
葉的順序永遠是相同的,因爲我使原來陣列手動感謝@deceze – cgwebprojects 2012-01-31 01:40:37