[ create a new paste ] login | about

Link: http://codepad.org/CeZewRNT    [ raw code | output | fork ]

PHP, pasted on Sep 8:
1
2
3
4
5
6
7
8
9
<?php

$array1 = array(3,4,1);
$array2 = array(3,1,2);

$result = array_unique(array_merge($array1, $array2));
sort($result);

var_export($result);


Output:
1
2
3
4
5
6
array (
  0 => 1,
  1 => 2,
  2 => 3,
  3 => 4,
)


Create a new paste based on this one


Comments: