The basename() function returns the filename from a path.
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.
basename() operates naively on the input string, and is not aware of the actual filesystem, or path components such as "..".
The above example will output:
Parameter | Description |
---|---|
path | Required. Specifies the path to check |
suffix | Optional. Specifies a file extension. If the filename has this file extension, the file extension will not show |