preg_replace $string = "rntsoft"; $pattern = '/(.*?)<\/a>/i'; $replacement = '\2: \1'; $string = preg_replace($pattern, $replacement, $string); print($string);?>