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

WBOY
Release: 2016-06-23 13:41:59
Original
996 people have browsed it

define('AAA',str_replace('\\','/',dirname(__FILE__)));include(AAA.'/bbb/c.php');include(dirname(__FILE__).'/bbb/d.php');
Copy after login

效果都是一样的?


回复讨论(解决方案)

不需要!
建议你统一使用 /
对于函数返回的 \ 也不需要管他

效果是一样的。

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!