php - preg_replace between [{ and }] -
i have string :
$string='my string [{text_001}] string [{text_002}] ';
i replace preg_replace [{something}] $something (ex : [{text_001}] -> $text_001).
i have error in preg_replace :
$string = preg_replace('/([{.+?)+(}])/i', "$1", $string);
$string = preg_replace('~\[\{(.+?)\}\]~', "\$$1", $string); # string $text_001 string $text_002
Comments
Post a Comment