just checking with preg_match, you can add many different words to the template, just use the separator |between the words
$str = "it is a test";
if (preg_match("[it|test]", $str) === 1)
{
echo "it matches";
}
Sorry, I didn’t know that you are dealing with other languages, you can try this
$str = "你好 abc efg";
if (preg_match("/\b(你好|test)\b/u", $str) === 1)
{
echo "it matches";
}
, \b ,