【发布时间】:2017-10-11 20:17:28
【问题描述】:
$string = "/*123123123*/";
$string = "123/*123123*/";
$string = "/*123123*/123";
$string = "123/*123123*/123";
对于所有这些变体,我需要返回 true,因此 /* 和 */ 存在于字符串中。
试过
if(preg_match("/(/*&*/)/i", $string)){
$flag=true;
}
else{
$flag=false;
}
但没有成功:c
【问题讨论】:
-
只要使用
strpos
标签: php string boolean substring