PHP function basename()

Availability in PHP 4.0

Returns filename component of path

Parameters

Parameter Data type Default value Note
$path string not A path.
$suffix string null If the filename ends in suffix this will also be cut off.

Return values

string

the base name of the given path.

Other resources

Official basename documentation

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.