更新时间:2023-02-19 12:18:33
您可以使用正则表达式,并用\b
单词边界将单词包围起来
You can do this with regex, and surrounding the word with \b
word boundary
preg_match("~\bMures\b~",$string)
示例:
$string = 'Maramures';
if ( preg_match("~\bMures\b~",$string) )
echo "matched";
else
echo "no match";