Answers for "filter array when a value is different php"

PHP
-2

filter value in array php return single value

?php
$data= [
    0 => [1, 'test1'],
    1 => [2, 'test2'],
    2 => [3, 'test3'],
];

$ids = array_map(function($item) {
    return $item[0];
}, $data);

var_dump($ids);
Posted by: Guest on July-22-2020

Code answers related to "filter array when a value is different php"

Browse Popular Code Answers by Language