Syntax
| string basename ( string $path [, string $suffix] ); |
Definition and Usage
Given a string containing a path to a file, this function will return the base name of the file.
Paramters
| Parameter | Description |
|---|---|
| path | A file path. |
| suffix | If the filename ends in suffix this will also be cut off. |
Return Value
Returns the base name of the given path.
Example
Following is the usage of this function:
<?php |
This will produce following result:
File name is index.php |