regex_replaceParameter PositionTypeRequiredDefaultDescription1stringYesn/aThis is the regular expression to be replaced.2stringYesn/aThis 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.");
?>
]]>
Where index.tpl is:
This should output:
See also replace
and escape.