Home > php教程 > php手册 > PHP正则的Unknown Modifier错误解决方法

PHP正则的Unknown Modifier错误解决方法

WBOY
Release: 2016-06-06 20:32:54
Original
1190 people have browsed it

PHP正则时出现Unknown Modifier错误解决方法

如下正则:

会提示:

原因是:

在正则模式中,用/做定界符,但正则中也含有/,因此会出现此错误,PHP误当后面的一个中的斜杠是结束的定界符。

解决办法:

1、加一个转义符:

2、改其它定界符:如

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template