Array (
[0] => Array (
[id] => 1
[user_id] => 1
[login] => test
[token] => test
[expires] => 123
[childs] => Array (
[0] => Array (
[id] => 1
[item_id] => 1
[project_id] => 3
[state] => OFF
[name] => Test 3
)
[1] => Array (
[id] => 2
[item_id] => 1
[project_id] =>
[state] => OFF
[name] => Test 2
)
)
)
)
<?php
$array = array(
[
'id' => '1',
'user_id' => 1,
'child' => [
[
'id' => 1,
'item_id' => 1,
'project_id' => 3
],
[
'id' => 2,
'item_id' => 2,
'project_id' => 0
]
]
]
);
var_dump(array_filter($array[0]['child'], function($v, $k) {
return $k == 'project_id' && $v != 0;
}, ARRAY_FILTER_USE_BOTH));
array(1) {
[0]=>
array(3) {
["id"]=>
int(1)
["item_id"]=>
int(1)
["project_id"]=>
int(3)
}
}