Collection of PHP path functions_PHP tutorial

WBOY
Release: 2016-07-15 13:34:29
Original
1219 people have browsed it

PHP path function string realpath ( string $path ) returns the normalized absolute path name

realpath() will detect what $path points to Whether the target file (or folder) actually exists is equivalent to calling file_exists($path).

If the target file exists and is not a symbolic link (called "shortcut" in Windows), the absolute path name of the file is returned and does not contain '/./' or '/../'.
If the target file is a symbolic link or does not exist, realpath() returns FALSE.

PHP path function string dirname (string $path) returns the directory part of the path

dirname() will not detect whether the file (or folder) pointed to by $path actually exists.

Regardless of whether the target file exists, the result will return the absolute path (directory part) of the file.

PHP path function mixed pathinfo ( string $path [, int $options ] ) returns file path information

dirname() will not detect the file (or folder) pointed to by $path Does it really exist?

PHP path function pathinfo() returns an associative array containing path information, including the following array units: dirname, basename, filename, and possible extensions.

The dirname and basename array unit parts are equivalent to the results returned by executing dirname() and basename().

string basename ( string $path [, string $suffix ] ) Returns the file name part of the path

The basename() of the PHP path function will not detect the file (or file) pointed to by $path folder) actually exists.

Regardless of whether the target file exists, the result will return the file name.
If the file name ends with $suffix, the returned file name does not contain the $suffix part.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445992.htmlTechArticlePHP path function string realpath ( string $path ) returns the normalized absolute path name realpath() will detect $path Whether the target file (or folder) pointed to actually exists, equivalent to calling...
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!