📜  php combine 2 arrays keep duplicates - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:23.998000             🧑  作者: Mango

代码示例1
$arrKeys = array('str', 'str', 'otherStr');
$arrVals = array('1.22', '1.99', '5.17');
function foo($key, $val) {
   return array($key=>$val);
}

$arrResult = array_map('foo', $arrKeys, $arrVals);