Reputation: 4693
i am trying to remove everything in between html comments <!-- REMOVE --> in php using regex. can anyone lend a hand please
<!--
-->
$str = preg_replace('/\<!--.*\-->/', '', $str);
Upvotes: 0
Views: 1988
Reputation: 12872
Try preg_replace('/<!--.*-->/sU', '', $str);
preg_replace('/<!--.*-->/sU', '', $str);
Upvotes: 1