Documentation

Path
in package

Table of Contents

Methods

canonicalize()  : string
join()  : string
Join path components together

Methods

canonicalize()

public static canonicalize(string $path[, string|null $base = null ][, string $separator = DIRECTORY_SEPARATOR ]) : string
Parameters
$path : string
$base : string|null = null
$separator : string = DIRECTORY_SEPARATOR
Return values
string

join()

Join path components together

public static join(array{0: string, 1: (string|string[])[]}|array<string|int, string|array<string|int, string>> ...$args) : string
Parameters
$args : array{0: string, 1: (string|string[])[]}|array<string|int, string|array<string|int, string>>
Path::join('a/', '/b', 'c/'); // "a/b/c/" -- de-dup separators
Path::join(['a/','/b'], '/c/'): // "a/b/c/" -- string or string[] parts
Path::join("\\", ['a', 'b', 'c']); // "a\\b\\c" -- separator as first argument, followed by array
Path::join("@@@", ['a', 'b', 'c']); // "a@@@b@@@c" -- arbitrary length separator
Path::join('a', null, 'b', [], 'c'); // "'"a/b/c" -- nulls and empty arrays ignored
Return values
string

        
On this page

Search results