Sort all given paths/filenames by its path length. Long path names will be listed first. This method can be
useful if you have for instance a bunch of files/directories to delete. By sorting them by lengh you can make
sure to delete all files within the folders before deleting the actual folder.
public static sortFilesDescByPathLength ( string[] $files ) : string[] | ||
$files | string[] | |
return | string[] |