我尝试后续串切HTML标签和包装HTML标签再次部件/ 1
<p>
string
<b>
bold
<em>italic string</em>
also(bold)
</b>
</p>
转换为这个字符串
<p>
string
</p> <!--------------------------------------- insert -->
<b>
bold
</b> <!------------------------------------ insert -->
<em>italic string</em>
<b> <!------------------------------------ insert -->
also(bold)
</b>
<p> <!---------------------------------------- insert -->
</p>
我知道这是不合法的HTML,但我需要这个为我的项目。 ...正则表达式是一种好方法,但我只是没有解决。
整个谢灵运将是动态的,
我的想法是,正则表达式
// open tag close
$regex = '<(.*?)>(.*?)</(.*?)>'
if ($1 != $3) {
$newString = <$1>$2</$1></$3>
}
但不工作!
......究竟是什么问题? – Rogue
这是一样的字符串总是还是动态的? – Vishnu
@Rogue我需要在打开或关闭一个antother之前插入动态“TAG-Breakpoint”TAG 要被转换的字符串istdynamic –