Menu Riverview Church

BASENAME

Returns trailing name component of path

SYNTAX

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

PARAMETERS

path

A path. On Windows, both slash (/) and backslash (\) are used as directory separator character. In other environments, it is the forward slash (/).

suffix

If the name component ends in suffix this will also be cut off.

RETURN

Returns the base name of the given path.

EXAMPLES

PATH

file.extension

SUFFIX

file

3

file.extension
file
..
.
directory
directory
..
.

..
.

PHP