Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试 使用正则表达式在 php 中<!--删除html 注释之间的所有内容。-->有人可以帮忙吗
<!--
-->
$str = preg_replace('/\<!--.*\-->/', '', $str);
尝试preg_replace('/<!--.*-->/sU', '', $str);
preg_replace('/<!--.*-->/sU', '', $str);