Answers for "array unique is not working on array of objects in php"

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
0

unique key value array php

$input = array_map("unserialize", array_unique(array_map("serialize", $input)));
Posted by: Guest on February-15-2021

Code answers related to "array unique is not working on array of objects in php"

Browse Popular Code Answers by Language