- str_replace: documentation ( source)
- explode: documentation ( source)
<?php
$text_string = '+TEST+';
$text = explode("+", $text_string);
$text = $text[1];
$replaced_text = str_replace("+$text+", "<em>$text</em>", $text_string);
echo $replaced_text; // output: <em>TEST</em>
?>