Answers for "array unique on array column which is an array 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

get unique array from multidimentional array by value in php

$uniquePids = array_unique(array_map(function ($i) { return $i['pid']; }, $holder));
Posted by: Guest on January-30-2021

Browse Popular Code Answers by Language