Preg_replace in php

I want to replace the content from the string that is contained in {content}. These are multilines, etc. The preg_replace function should remove all {com no rug Cop}

+3
source share
4 answers

preg_match_all ('/ {* ([^}] + *)} / s'), $ content, $ matches)

+1
source

Try the following:

$result = preg_replace('/\{[^}]*\}/s', 'replacement content', $subject);
+2
source

Update

$str = preg_replace('/(?<=\{).+?(?=\})/s', '', $str);

.

+1

?

preg_match_all('/\{([^}]+\)}/s'), $content, $matches)

s, . $matches , .

0

All Articles