您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

H标签的正则表达式要怎么写

2026/2/4 19:37:13发布15次查看
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的标签
回复内容: 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]*?)
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product