Answers for "php filter array based on contains"

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 "php filter array based on contains"

Browse Popular Code Answers by Language