-2

I have an array values. Inside the array some multiple data but how to combine or merge these multiple records. some values inside the single array are multiples . How to merge these ?

    Array
    (
    [0] => plxliupp
    [1] => plxliupp
    [2] => dg_w12
    [3] => col4312
    [4] => Iphone6s
    [5] => Ndry_milk
    [6] => smj7
    [7] => ovn 02 o3
    [8] => allwin6406f
    )

After remove multiples values. array like this

    Array
    (
    [0] => plxliupp
    [1] => dg_w12
    [2] => col4312
    [3] => Iphone6s
    [4] => Ndry_milk
    [5] => smj7
    [6] => ovn 02 o3
    [7] => allwin6406f
    )

thanks for answering

Musawer_ali
  • 11
  • 1
  • 8
  • 4
    https://www.php.net/array_unique? – Jeto Mar 25 '19 at 14:48
  • 1
    [`array_combine`](https://www.php.net/manual/en/function.array-combine.php), [`array_merge`](https://www.php.net/manual/en/function.array-merge.php), or [`array_unique`](https://www.php.net/manual/en/function.array-unique.php) - take your pick. – Script47 Mar 25 '19 at 14:48

1 Answers1

1
$array = array("a" => "moon", "star", "b" => "moon", "star", "sky");

// Deleting the duplicate items
$result = array_unique($array);
print_r($result);
Onur KAYA
  • 234
  • 1
  • 9