<?php
$input = array (
0 =>
array (
'values' =>
array (
1 => '123456',
2 => 'Blue',
3 => 'Container',
4 => '03-01-2020', // start date
5 => '03-01-2021', // exp date
6 => '',
7 => '',
),
),
1 =>
array (
'values' =>
array (
1 => '21312',
2 => 'Green',
3 => 'Box',
4 => '2019-04-12', // start date
5 => '', //exp date
6 => '',
7 => '',
),
),
2 =>
array (
'values' =>
array (
1 => '434324',
2 => 'Orange',
3 => 'Box',
4 => '2018-04-28', // start date
5 => '2019-04-23', // exp date
6 => '',
7 => '',
),
),
);
$expiryDates = array_map(static function ($entry) {
return strtotime($entry['values'][5]);
}, $input);
echo date('d F Y', max($expiryDates));
- Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- 03 January 2021
preferences:
93.31 ms | 407 KiB | 5 Q