Answers for "array_unique laravel"

PHP
1

array_unique

<?php
$input = array("a" => "green", "red", "b" => "green", "blue", "red");
$result = array_unique($input);
print_r($result);
?>

Array
(
    [a] => green
    [0] => red
    [1] => blue
)
Posted by: Guest on May-26-2020
2

get unique values in laravel

$users = User::select('name')->distinct()->get();
Posted by: Guest on February-19-2021

Browse Popular Code Answers by Language