<?php
$array = [
'ticket_number' => 'sdfsdfsdf 2',
'strategy_id' => '5',
'journal_entries_strategy_conditions' => [
0 => [
'strategies_condition_id' => ''
],
1 => [
'strategies_condition_id' => '1'
]
],
'timeframe' => '',
];
foreach ($array['journal_entries_strategy_conditions'] as $i => $row) {
if (!$row['strategies_condition_id']) {
unset($array['journal_entries_strategy_conditions'][$i]);
}
}
var_export($array);
- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
- array (
'ticket_number' => 'sdfsdfsdf 2',
'strategy_id' => '5',
'journal_entries_strategy_conditions' =>
array (
1 =>
array (
'strategies_condition_id' => '1',
),
),
'timeframe' => '',
)
preferences:
79.11 ms | 407 KiB | 5 Q