Creates a Closure that sorts an array or iterable with a "natural order" algorithm — e.g. "img10" comes after "img2" instead of before it.
/**
* @return Closure(iterable<int|string, mixed>):mixed[]
*/
Arrays\natsort(): ClosureWhen Arrays\natsort() is called, it returns the following Closure which can be used like a regular function.
/**
* @param iterable<int|string, mixed> $source
* @return mixed[]
*/
$function (iterable $source): arrayThis can be used to create a simple closure which can be used as a regular function.
$nat = Arrays\natsort();
print_r($nat(['img10', 'img2', 'img1']));
// ['img1', 'img2', 'img10']