I want to replace content from a string which is contained within {content}. It an be multilines etc. The preg_replace function should remove the whole { com no mat ment }
Try this:
$result = preg_replace('/\{[^}]*\}/s', 'replacement content', $subject);
$str = preg_replace('/(?<=\{).+?(?=\})/s', '', $str);
See it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With