php dirname function returns the directory name_PHP tutorial

WBOY
Release: 2016-07-20 11:00:56
Original
980 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...
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!