/(W|^)some(W|$)/ui
-在线编辑器查找字符串中的2个单词
当我尝试在本地找到3字
string: "some text for some word in somes"
我的本地服务器有什么问题?
试试这样:
$subject ='some text for some word in somes';
echo (preg_match_all('~bsomeb~', $subject));
现场演示