How can I convert the following preg_replace to preg_replace_callback?
$this->template = preg_replace ( "#\\[group=(.+?)\\](.*?)\\[/group\\]#ies",
"\$this->check_group('\\1', '\\2')", $this->template );
What I've tried:
$this->template = preg_replace_callback( "#\\[not-group=(.+?)\\](.*?)\\[/not-group\\]#ies",
function($this) {
return $this->check_group($this[1], $this[2], false);
}
, $this->template );
and the above preg_replace_callback gives me an empty result.