normalizePath() public static method
Normalizes a file/directory path.
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 string normalizePath ( $path, $ds = DIRECTORY_SEPARATOR ) | ||
|---|---|---|
| $path | string |
The file/directory path to be normalized |
| $ds | string |
The directory separator to be used in the normalized result. Defaults to |
| return | string |
The normalized file/directory path |
Please login to continue.