Answers for "how to ignore duplicate value while merging array php"

PHP
1

php array merge skip diplicate

You can use the PHP array_unique() function and PHP array_merge() function together to merge two arrays into one array without duplicate values in PHP.
Posted by: Guest on December-16-2020
0

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);
Posted by: Guest on August-17-2020

Code answers related to "how to ignore duplicate value while merging array php"

Browse Popular Code Answers by Language