Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
 
PREVIOUS NEXT
Tagged: #filter #array #php #return #single
ADD COMMENT
Topic
Name
4+3 =