Is replacing a line break UTF-8 safe?

dhfola

New Member
If I have a UTF-8 string and want to replace line breaks with the HTML \[code\]<br>\[/code\] , is this safe?\[code\]$var = str_replace("\r\n", "<br>", $var);\[/code\]I know str_replace isn't UTF-8 safe but maybe I can get away with this. I ask because there isn't an mb_strreplace function.
 
Back
Top