At the time of writing this, the smarty.net website appears to be down.
Anyway, how do I replace line breaks with a space in a smarty variable? Is it something like this {$var|regex_replace:'[\\r\\n]':'\s'}
? I tried it but it didn't work.
Try this if it works:
{$var|regex_replace:"/[\r\n]/" : " "}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With