欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php正则表达式 表示点号

程序员文章站 2022-05-17 17:20:49
...
'/\.'和'/\.?'和‘/\/’表示同个意思?
用到下面的代码里
$pattern = '/ajax/ppp/shit.html';
$pattern = addcslashes($pattern, "/\.?");
?
结果都是$pattern的值都是'\/ajax\/ppp\/shit\.html'

回复讨论(解决方案)

这和正则有啥子关系,建议你去看下addcslashes() 函数的用法。