在一个字符串中,我有这样的东西:
[select|blog]
Some text some text some text
[/select]
more text more text more text
[select|information]
Some text some text some text
[/select]
现在使用 preg_match 我希望函数:
- 获取 [select] 标签之间的文本
- 更改
- 将其重新插入字符串
- 删除选择标签
所以最终它会变成这样:
Changed text1 Changed text1 Changed text1
more text more text more text
Changed text2 Changed text2 Changed text2
希望你们能帮帮我。谢谢!:)