<?php
var_dump(floatval('Undefined'));
echo PHP_EOL;
$unresponsives2 = $unresponsives = [
[
"Customer",
"172.52.46.75",
"2022-04-01 16:20:45",
"1817",
"nxlog",
"2328.02 Hours"
],
[
"Customer",
"172.25.89.45",
"2022-04-01 16:20:45",
"1817",
"nxlog",
"Undefined"
],
[
"Customer",
"172.19.10.94",
"2022-04-01 16:20:45",
"1817",
"nxlog",
"2324.02 Hours"
],
[
"Customer",
"172.19.10.94",
"2022-04-01 16:20:45",
"1817",
"nxlog",
"2322.02 Hours"
],
[
"Customer",
"172.19.10.94",
"2022-04-01 16:20:45",
"1817",
"nxlog",
"Undefined"
],
];
$hours = array_column($unresponsives, 5);
if ($undefined = array_keys($hours, 'Undefined')) {
$hours = array_replace($hours, array_fill_keys($undefined, PHP_INT_MAX));
}
array_multisort($hours, SORT_DESC, SORT_NUMERIC, $unresponsives);
var_export($unresponsives);
echo PHP_EOL . PHP_EOL;
$hours = array_column($unresponsives2, 5);
if ($undefined = array_keys($hours, 'Undefined')) {
$hours = array_replace($hours, array_fill_keys($undefined, PHP_INT_MIN));
}
array_multisort($hours, SORT_ASC, SORT_NUMERIC, $unresponsives2);
var_export($unresponsives2);
preferences:
24.56 ms | 410 KiB | 5 Q