basename

basename

(PHP 4, PHP 5, PHP 7)

basenameReturns trailing name component of path

Description

string basename ( string $path [, string $suffix ] )

Given a string containing the path to a file or directory, this function will return the trailing name component.

Note:

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