text text text
text text text
{test}
content
content
content
{/test}
text text text
text text text
我需要从上面的字符串两个不同的结果: 1. {test}
content
content
content
{/test}
我想用下面的代码实现的事情:在文本中匹配指定的单词不区分大小写且只有一次,并将其替换为链接。 我有以下的preg_match的字“富”在一个字符串匹配: if (preg_match("/\bfoo\b/i", $text, $results, PREG_OFFSET_CAPTURE)) {
// substr_replace the word 'foo' for a link <a h