Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php combine 2 arrays keep duplicates

$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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #combine #arrays #duplicates
ADD COMMENT
Topic
Name
3+2 =