<?php
$props = [
['name' => 'Mathmatics', 'time' => '03:01:PM - 04:50:PM'],
['name' => 'History', 'time' => '11:30:AM - 01:30:PM'],
['name' => 'French', 'time' => '01:31:PM - 03:00:PM'],
];
array_multisort(
array_map(
fn($row) => DateTime::createFromFormat('h:i:A+', $row['time']),
$props
),
$props
);
var_export(DateTime::getLastErrors());
- Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- array (
'warning_count' => 1,
'warnings' =>
array (
8 => 'Trailing data',
),
'error_count' => 0,
'errors' =>
array (
),
)
preferences:
138.58 ms | 402 KiB | 121 Q