Skip to main content

Module path

Module path 

Source
Expand description

Path functions.

Functionsยง

basename
PHP basename($path, $suffix) (Unix separators), as php_basename: the last component, trailing slashes ignored, with suffix removed when the component ends with it and is longer than it.
dirname
PHP dirname($path) (one level, Unix separators), as zend_dirname.
expand_filepath
expand_filepath(): the absolute path PHP opens for path. A relative path is resolved against the working directory, then . and .. components and repeated slashes are removed lexically (a trailing slash stays), without resolving symbolic links. None for an empty path or one longer than MAXPATHLEN.
file_get_contents
file_get_contents($path) for a plain file path: the bytes of the file at expand_filepath(path), or None where PHP returns false (no such file, a directory, no permission). Paths with a NUL byte are None; PHP functions raise a \ValueError for them before opening.
pathinfo_extension
PHP pathinfo($path, PATHINFO_EXTENSION): what follows the last . of basename, or an empty string when it has no ..