The normalization does the following work:
- Convert all directory separators into DIRECTORY_SEPARATOR (e.g. "\a/b\c" becomes "/a/b/c")
- Remove trailing directory separators (e.g. "/a/b/c/" becomes "/a/b/c")
- Turn multiple consecutive slashes into a single one (e.g. "/a///b/c" becomes "/a/b/c")
- Remove ".." and "." based on their meanings (e.g. "/a/./b/../c" becomes "/a/c")
public static normalizePath ( string $path, string $ds = DIRECTORY_SEPARATOR ) : string | ||
$path | string | the file/directory path to be normalized |
$ds | string | the directory separator to be used in the normalized result. Defaults to `DIRECTORY_SEPARATOR`. |
Результат | string | the normalized file/directory path |