【发布时间】:2012-12-07 09:59:38
【问题描述】:
我有问题要删除这个标签<!-- comment -->look 太该标签中的空白空间。如何删除它并将其更改为空字符而不是空格使用preg_replace()
解决了
只需使用以下语法:
$content = "hello <!--- comment --> world";
$html = preg_replace('/<!-- comment -->/i','',$content);
输出
hello world
【问题讨论】:
标签: php html preg-replace