The PHP dirname function returns the directory name dirname
(PHP 4, PHP 5)
DirName-Returns the component path of the directory name
Describe
String dirname (string $ path)
Given that a string contains the path of the file, the function returns the name of the directory.
Parameters
Path
A path.
In Windows, these two slashes (/) and backslashes () are used as directory separators. In other environments, it is a forward slash (/).
return value
The name of the directory returned. If there is no path to the slash, a dot ('. ') Returns, displays the current directory. Otherwise, returns the string path for any trailing/component deletions.
Modify
Release Notes
5.0.0 dirname () is now a binary security
4.0.3 dirname () is a fixed, compatible POSIX.
Instance
Example # 1 dirname () example
http://www.bkjia.com/PHPjc/445483.html www.bkjia.com true http://www.bkjia.com/PHPjc/445483.html techarticle The php dirname function returns the directory name DirName (PHP 4, PHP 5) dirname-Returns part of the directory name of the path description string dirname (string $ path) given a word ...