how to add two array in single array without repetation in php
<?php
$array1=array("CPU","Mouse","Monitor");
$array2=array("Key-Board","Monitor","Printer");
$array = array_unique(array_merge($array1, $array2));
print_r($array);
?>
how to add two array in single array without repetation in php
<?php
$array1=array("CPU","Mouse","Monitor");
$array2=array("Key-Board","Monitor","Printer");
$array = array_unique(array_merge($array1, $array2));
print_r($array);
?>
how to remove duplicate values from a multidimensional array in php
We used this to de-duplicate results from a variety of overlapping queries.
$input = array_map("unserialize", array_unique(array_map("serialize", $input)));
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);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us