Usephul

PathInfo
in package

Provides information about a file path.

Note:

PathInfo operates naively on the path string, and is not aware of the actual filesystem, or path components such as "..".

Caution PathInfo is locale-aware, so for it to parse a path containing multibyte characters correctly, the matching locale must be set using the setlocale() function.

Table of Contents

Properties

$basename  : string
The name of the directory or the name and extension of the file.
$dirname  : string|null
The path of the directory or file.
$extension  : string|null
The extension of the file.
$filename  : string
The name of the file (without the extension) or directory.
$path  : string

Methods

__construct()  : mixed

Properties

$basename read-only

The name of the directory or the name and extension of the file.

public string $basename

$dirname read-only

The path of the directory or file.

public string|null $dirname

$extension read-only

The extension of the file.

public string|null $extension

$filename read-only

The name of the file (without the extension) or directory.

public string $filename

Methods

__construct()

public __construct(string $path) : mixed
Parameters
$path : string

The path to be parsed.


        
On this page

Search results