regex_replace
Parameter Position
Type
Required
Default
Description
1
string
Yes
n/a
This is the regular expression to be replaced.
2
string
Yes
n/a
This is the string of text to replace with.
A regular expression search and replace on a variable. Use the
syntax for preg_replace() from the PHP manual.
regex_replace
assign('articleTitle', "Infertility unlikely to\nbe passed on, experts say.");
$smarty->display('index.tpl');
?>
]]>
Where index.tpl is:
This should output: