Phpbasename function. Next, let's take a look at the components of the file path. basename function example tutorial. Next, let's take a look at the basename function example tutorial about the components of the file path. basename function example tutorial
Let's take a look at the components of the component path.BasenameFunction instance tutorial
Basename
(PHP 4 and PHP 5)
Basename-components of the returned file path
Description
String basename (string $ path [, string $ suffix])
Given that a string contains a path file, this function returns the base file name.
Parameters
Path
A path.
In Windows, the two slash (/) and backslash () are used as directory separators. In other environments, it is a forward slash (/).
Suffix
If the file name ends with the suffix is also cut off.
Return value
Return base name to specify the path.
Modify
Version description
Add Extension Parameters for 4.1.0
Instance
Example #1 basename ()
$ Path = "/home/httpd/html/index. php ";
$ File = basename ($ path); // $ file is set to "index. php"
$ File = basename ($ path, ". php"); // $ file is set to "index"
?>
Refer to the following example to provide a basename function instance tutorial basename (PHP...