Home  >  Article  >  Backend Development  >  为什么要转义呢

为什么要转义呢

WBOY
WBOYOriginal
2016-06-23 13:34:091224browse

str_replace('' \\,'/',dirname(__FILE__)));
上面中红色部分是转义斜杠,为啥要转呢


回复讨论(解决方案)

因为\是特殊字符。

只是为了让它变成一个普通字符,让他失去语言意义

Statement:
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