我想删除两个$符号之间的html标记,例如:
<p>this is $ and <em> example of </em> what $ I need help with</p>
我想删除$之间的标签,我得到了下面的表达式,但它不在那里
re = <[^>]*>(?=.*'$)
我试着用"向后看"来完成这项工作,但是没有成功
$str = '<p>this is $ and <em> example of </em> what $ I need help $with</p>';
echo preg_replace_callback(
'~'$.*?'$~',
function($matches) {
return strip_tags($matches[0]);
},
$str);