Answers for "laravel array remove duplicates"

PHP
18

php remove duplicates from array

<?php
$fruits_list = array('Orange',  'Apple', ' Banana', 'Cherry', ' Banana');
$result = array_unique($fruits_list);
print_r($result);
?>
  
Output:

Array ( [0] => Orange [1] => Apple [2] => Banana [3] => Cherry )
Posted by: Guest on March-04-2020
0

laravel remove duplicates from array

$array = array(1, 2, 2, 3);
$array = array_unique($array); // Array is now (1, 2, 3)
Posted by: Guest on December-23-2020
0

laravel collection remove duplicates

$unique = $collection->unique();
Posted by: Guest on March-09-2020

Code answers related to "laravel array remove duplicates"

Browse Popular Code Answers by Language