$text = 'Why hello there {name}, how are you today?';
$name = 'Brad';
$text = str_replace('{name}', $name, $text);
echo $text; // Why hello there Brad, how are you today?
Or were you looking for something more generic? If so, you could do a [man]preg_match_all/man to find all occurrences of {something} (where 'something' looks like whatever you want, e.g. a valid PHP variable name). You could then walk through the array of matches and use [man]isset/man to determine if a PHP variable exists and, if so, [man]str_replace/man the placeholder with its value.