PHP Identical or Duplicate Array Elements
To remove identical array elements, use the function array_unique.
See the example:
<?php
$arr = [1, 2, 2, 3, 4, 4];
$res = array_unique($arr);
var_dump($res);
?>
Code execution result:
[1, 2, 3, 4]