Home > Backend Development > PHP Tutorial > 使用dirname(_FILE_) 需要把反斜杠转化为斜杠吗?解决方法

使用dirname(_FILE_) 需要把反斜杠转化为斜杠吗?解决方法

WBOY
Release: 2016-06-13 12:13:25
Original
1280 people have browsed it

使用dirname(__FILE__) 需要把反斜杠转化为斜杠吗?

<br />define('AAA',str_replace('\\','/',dirname(__FILE__)));<br />include(AAA.'/bbb/c.php');<br />include(dirname(__FILE__).'/bbb/d.php');<br />
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template