文字列には、次のようなものがあります。
[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
皆さんが私を助けてくれることを願っています。ありがとう!:)