Fastest Web Hosting

how do i merge arrays without duplicate

0 votes
asked Dec 17, 2016 in PHP by anonymous

1 Answer

0 votes
answered Mar 5 by vinod.kumar (540 points)

Hi

you can use bellow code for merge two array without duplicate here the code

$array1  = array('ram','vinod','sham');
$array2  = array('ramkumar','vinod','shamk');
$array3 = array_unique(array_merge($array1,$array2), SORT_REGULAR);
print_r($array3);

now you can check output.

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's
...