Answers for "php merge arrays remove duplicates"

PHP
2

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);
?>
Posted by: Guest on October-24-2020
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

Browse Popular Code Answers by Language