I have a string
"PRINT CHIFFON<BR /><BR />
"
I am trying to remove any newline symbols and
tags.
$i->colour_code = str_replace('<br>', '', strip_tags($i->colour_code));
$i->colour_code = str_replace('<br \/>', '', strip_tags($i->colour_code));
$i->colour_code = preg_replace("/[\n\r]/","",$i->colour_code);
That still does not work. Any ideas will be appreciated as this issue causes the whole system stop working
You don’t need to escape the slash in the second line of replacements. In fact, since you’re running it through
strip_tags, you don’t even need the first two replacements. Try this:Just make sure that
$i->colour_codeis not readonly.