I have this:
$text = 'This is some text /*Comment 1 */ . Some more text{ This is to let you know that /* this is a comment*/. A comment /*this one is */ can be anything }. So the next thing { This is to let you know that /* this is a comment*/. A comment /*this one is */ can be anything } is another topic. /*Final comment*/';
Need this:
$text = 'This is some text /*Comment 1 */ . Some more text{ This is to let you know that . A comment can be anything }. So the next thing { This is to let you know that . A comment can be anything } is another topic. /*Final comment*/';
Tried this:
$text = preg_replace("/\/\*.*?\*\//", "", $text);
The problem is that what I have tried, is removing all the comments. I just want the comments appearing within { }
to be removed. How to do this?