/**
 * Get the file extension from a file path.
 *
 * @return string The extension of a given file.
 */
public function extension(): string

Examples

$result = $filesystem->file('/foo/1.txt')->extension();

echo $result;

The above example will output:

txt

Getting Started

Methods

Filesystem
File
Directory