Home > Backend Development > PHP Tutorial > php dirname function returns the directory name_PHP tutorial

php dirname function returns the directory name_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-20 11:00:56
Original
1048 people have browsed it

php dirname function returns the directory name ​ dirname
(PHP 4, PHP 5)

dirname - Returns the component path of the directory name

Description
String dirname (String $path)
Given a string containing the path to a file, this function will return the name of the directory.

Parameters

Path
a path.

In Windows, both slash ( / ) and backslash ( ) serve as directory separators. In other environments, it is a forward slash ( / ).


Return value
The directory name returned. If there is no slash in the path, a dot ('.') is returned, showing the current directory. Otherwise, the string path is returned with any trailing/components removed.

Modify

Release Notes
5.0.0 dirname ( ) is now binary safe
4.0.3 dirname() is fixed for POSIX compliance.


Example

Example #1 dirname()

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445483.htmlTechArticlephp dirname function returns the directory name dirname (PHP 4, PHP 5) dirname - returns the components of the directory name Path description string dirname (String $path) Given a word...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template