- var_dump: documentation ( source)
- array_intersect_key: documentation ( source)
- array_column: documentation ( source)
- array_filter: documentation ( source)
<?php
$arr = [
'ticket_number' => 'sdfsdfsdf 2',
'strategy_id' => '5',
'journal_entries_strategy_conditions' => [
0 => [
'strategies_condition_id' => ''
],
1 => [
'strategies_condition_id' => '1'
]
],
'timeframe' => '',
];
$filtered = array_filter(array_column($arr['journal_entries_strategy_conditions'], 'strategies_condition_id'));
$arr['journal_entries_strategy_conditions'] = array_intersect_key($arr['journal_entries_strategy_conditions'], $filtered);
var_dump($arr);