Home > Backend Development > PHP Tutorial > 为什么不能输出反斜杠?

为什么不能输出反斜杠?

WBOY
Release: 2016-06-23 13:36:53
Original
1237 people have browsed it

 define('__DIR__', dirname(__FILE__)."\\");
 echo __DIR__;


回复讨论(解决方案)

__DIR__ 是魔术常量,能被你定义

__DIR__ 文件所在的目录。如果用在被包括文件中,则返回被包括的文件所在的目录。它等价于 dirname(__FILE__)。除非是根目录,否则目录中名不包括末尾的斜杠。(PHP 5.3.0中新增)

__DIR__ 是魔术常量,能被你定义

__DIR__ 文件所在的目录。如果用在被包括文件中,则返回被包括的文件所在的目录。它等价于 dirname(__FILE__)。除非是根目录,否则目录中名不包括末尾的斜杠。(PHP 5.3.0中新增)


非常感谢一楼,看的文件有点老,然后php又是最新的,没太注意,Thanks
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