How can I manipulate the usort function here to move objects missing a LastUse key to the bottom?
Short of have another loop prior to this that sets LastUse as a 0 value, I'm not entirely sure the best way to achieve it.
I'd be looking to the sorted LastUse values at the top of the list, and those that do not have a value at the bottom of the list.
usort($trackdata, function ($a, $b) {
return strtotime($b->LastUse) - strtotime($a->LastUse);
});
Should be something like this:
Didn't test it so if they swimp up to the top move minus sign from first row to second to change their position.