私はこれを内の関数にしていpreg_replace()
ます。
私はそれを次のように使用しています:
$pattern[] = "/\[test\](.*?)\[\/test\]/is";
$replace[] = $this->test('$1');
$content = preg_replace($pattern, $replace, $content);
次に、関数test()
は送信された値を出力します。ただし、値は常にだけです$1
が、からのコンテンツである必要があります[test]...[/test]
。
これを行う方法はありますか?