代码
private function _code_callback($match){ return . str_replace('[', '[', $match[1]) .
;}加粗
private function _b_callback($match){ return $match[1];}
这个是代码的正则表达式
// replace [code]...[/code] with
...
$this->bbcode_table/[code\[/code]/is] = '_code_callback';
这个是加粗的正则表达式
// replace [b]...[/b] with ...
$this->bbcode_table/[b\[/b]/is] = '_b_callback';那么h标签的正则表达式要怎么写呢?
就是h1,h2,h3,h4,h5,h6的标签
回复内容: protected $bbcode_table = array();
代码
private function _code_callback($match){ return . str_replace('[', '[', $match[1]) .
;}加粗
private function _b_callback($match){ return $match[1];}
这个是代码的正则表达式
// replace [code]...[/code] with
...
$this->bbcode_table/[code\[/code]/is] = '_code_callback';
这个是加粗的正则表达式
// replace [b]...[/b] with ...
$this->bbcode_table/[b\[/b]/is] = '_b_callback';那么h标签的正则表达式要怎么写呢?
就是h1,h2,h3,h4,h5,h6的标签
([\s\s]*?)
