Home > php教程 > php手册 > 正则表达式和/的位置

正则表达式和/的位置

WBOY
Release: 2016-06-13 10:54:12
Original
1359 people have browsed it

[php]  

define('DEDEADMIN', preg_replace("/[\\/]{1,}/", '/', dirname(__FILE__) ) );  

注意[\\/] 里的 第一个 \ 其实是个独立的文本字符,而 \/ 表示把 / 的意义转义为普通的文本字符

如果把正则表达式[]里的内容换成 [\/\] 或 [\/\\] 是不行的。会报错。

 

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