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

Examples

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

echo $result;

The above example will output:

1

Getting Started

Methods

Filesystem
File
Directory