Smarty replace line breaks

At the time of this writing, smarty.net is not working.

Anyway, how to replace line breaks with space in smarty variable? Is it something like this {$var|regex_replace:'[\\r\\n]':'\s'}? I tried, but it did not work.

+3
source share
1 answer

Try it if it works:

{$var|regex_replace:"/[\r\n]/" : " "}
+5
source

All Articles