Home > php教程 > php手册 > body text

realpath自动清除路径中的点号

WBOY
Release: 2016-06-06 20:13:58
Original
853 people have browsed it

realpath自动清除路径中的点号,但仅限与点号出现在目录名和目录符号中间的情况。 php echo realpath('/var/www/test/constant../../array/');/var/www/test/arrayphp echo realpath('/var/www/test/constant./../array/');/var/www/test/arrayphp echo realp

realpath自动清除路径中的点号,但仅限与点号出现在目录名和目录符号中间的情况。

php > echo realpath('/var/www/test/constant../../array/');
/var/www/test/array
php > echo realpath('/var/www/test/constant./../array/');
/var/www/test/array
php > echo realpath('/var/www/test/constant/../array/');
/var/www/test/array
php > var_dump(realpath('/var/www/test/constan.t/../array/'));
bool(false)
Copy after login
Related labels:
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template